Skip to content

Commit

Permalink
Merge pull request #387 from uselagoon/coverage
Browse files Browse the repository at this point in the history
Add tests covering the main functionality of the ssh server component
  • Loading branch information
smlx authored Feb 16, 2024
2 parents 799156b + 9ec0c3d commit 9bebe9a
Show file tree
Hide file tree
Showing 11 changed files with 842 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- name: Calculate coverage
run: |
go test -v -covermode=atomic -coverprofile=cover.out.raw -coverpkg=./... ./...
# remove mocks from coverage calculation
grep -v mock_ cover.out.raw > cover.out
# remove generated code from coverage calculation
grep -Ev 'internal/mock|_enumer.go' cover.out.raw > cover.out
- name: Generage coverage badge
uses: vladopajic/go-test-coverage@bcd064e5ceef1ccec5441519eb054263b6a44787 # v2.8.2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/dist
/cover.out
/cover.out.raw
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ fuzz: mod-tidy generate

.PHONY: cover
cover: mod-tidy generate
go test -v -covermode=atomic -coverprofile=cover.out -coverpkg=./... ./...
go test -v -covermode=atomic -coverprofile=cover.out.raw -coverpkg=./... ./...
grep -Ev 'internal/mock|_enumer.go' cover.out.raw > cover.out
go tool cover -html=cover.out
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/prometheus/client_golang v1.18.0
github.com/zitadel/oidc/v3 v3.11.1
go.opentelemetry.io/otel v1.23.1
go.uber.org/mock v0.4.0
golang.org/x/crypto v0.19.0
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/oauth2 v0.17.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ go.opentelemetry.io/otel/metric v1.23.1 h1:PQJmqJ9u2QaJLBOELl1cxIdPcpbwzbkjfEyel
go.opentelemetry.io/otel/metric v1.23.1/go.mod h1:mpG2QPlAfnK8yNhNJAxDZruU9Y1/HubbC+KyH8FaCWI=
go.opentelemetry.io/otel/trace v1.23.1 h1:4LrmmEd8AU2rFvU1zegmvqW7+kWarxtNOPyeL6HmYY8=
go.opentelemetry.io/otel/trace v1.23.1/go.mod h1:4IpnpJFwr1mo/6HL8XIPJaE9y0+u1KcVmuW7dwFSVrI=
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
Loading

0 comments on commit 9bebe9a

Please sign in to comment.