Skip to content

Commit

Permalink
add unit-tests to regression pipeline (#6152)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabelf5 authored Aug 14, 2024
1 parent 2451f6c commit 746803b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,27 @@ jobs:
echo stable_tag: ${{ steps.vars.outputs.stable_tag }}
echo branch: ${{ steps.vars.outputs.branch }}
unit-tests:
name: Unit Tests
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Golang Environment
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod

- name: Run Tests
run: make cover

- name: Upload coverage to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
files: ./coverage.txt
token: ${{ secrets.CODECOV_TOKEN }} # required

helm-tests:
name: Helm Tests ${{ matrix.base-os }}
runs-on: ubuntu-22.04
Expand Down
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,16 @@ staticcheck: ## Run staticcheck linter

.PHONY: test
test: ## Run GoLang tests
go test -tags=aws -shuffle=on -race ./...
go test -tags=aws -shuffle=on -race -coverprofile=coverage.txt -covermode=atomic ./...

.PHONY: test-update-snaps
test-update-snaps:
UPDATE_SNAPS=true go test -tags=aws -shuffle=on -race ./...

cover: ## Generate coverage report
@./hack/test-cover.sh
cover: test ## Generate coverage report

cover-html: ## Generate and show coverage report in HTML format
go test -tags=aws -shuffle=on -race ./... -count=1 -cover -covermode=atomic -coverprofile=coverage.out
go tool cover -html coverage.out
cover-html: test ## Generate and show coverage report in HTML format
go tool cover -html coverage.txt

.PHONY: verify-codegen
verify-codegen: ## Verify code generation
Expand Down
12 changes: 0 additions & 12 deletions hack/test-cover.sh

This file was deleted.

0 comments on commit 746803b

Please sign in to comment.