Skip to content

Commit

Permalink
chore: update workflow to load test
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Dec 10, 2024
1 parent a06a507 commit c5d76ef
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,25 @@ jobs:
cache-
- name: Test
run: make test-prod

test-load:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Install Go
uses: buildjet/setup-go@v5
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- uses: buildjet/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
.bin
key: cache-${{ hashFiles('**/go.sum') }}-${{ hashFiles('.bin/*') }}
restore-keys: |
cache-
- name: Test
run: make test-load
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ test: manifests generate fmt vet envtest ## Run tests.
test-prod: manifests generate fmt vet envtest ## Run tests.
$(MAKE) gotest-prod

test-load: manifests generate fmt vet envtest ## Run tests.
$(MAKE) gotest-load

.PHONY: gotest
gotest:
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out
Expand All @@ -71,7 +74,7 @@ gotest:
gotest-prod:
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -tags rustdiffgen ./... -coverprofile cover.out

.PHONY: gotest-prod
.PHONY: gotest-load
gotest-load:
make -C fixtures/load k6
LOAD_TEST=1 KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./tests -coverprofile cover.out
Expand Down

0 comments on commit c5d76ef

Please sign in to comment.