Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unit-tests to regression pipeline #6152

Merged
merged 9 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.