Skip to content

Commit

Permalink
test: add basic go test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Jan 23, 2025
1 parent 7f1d3dc commit 58b0091
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/insights-handler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lagoon Insights Handler Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test-suite:
runs-on: ubuntu-latest
continue-on-error: false
strategy:
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"

- name: Set up testing dependencies
run: sudo apt-get update && sudo apt-get -y install build-essential && sudo apt-get clean

- name: Setup correct Go version
uses: actions/setup-go@v2
with:
go-version: '1.23'

- name: Run test
run: |
make test
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@ gettrivy:
runlocal:
go run main.go --problems-from-sbom=true --rabbitmq-username=guest --rabbitmq-password=guest --lagoon-api-host=http://localhost:8888/graphql --jwt-token-signing-key=secret --access-key-id=minio --secret-access-key=minio123 --disable-s3-upload=true --debug=true

.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...

.PHONY: vet
vet: ## Run go vet against code.
go vet ./...

.PHONY: test
test: fmt vet
go test -v ./...
2 changes: 1 addition & 1 deletion internal/handler/FactDataTransformer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestFactProcessor_TestMultipleFilters(t *testing.T) {
}
}

//ProcessLagoonFactAgainstRegisteredFilters
// ProcessLagoonFactAgainstRegisteredFilters
func TestFactProcessor_ProcessLagoonFactAgainstRegisteredFilters(t *testing.T) {

fact := LagoonFact{
Expand Down

0 comments on commit 58b0091

Please sign in to comment.