Skip to content

Commit

Permalink
test: add api unit tests to test workflow, exclude integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LuccaBitfly committed Feb 7, 2025
1 parent f58c2e6 commit 04c99cd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
working-directory: backend
run:
go install github.com/swaggo/swag/cmd/swag@latest && swag init --ot json -o ./pkg/api/docs -d ./pkg/api/ -g ./handlers/public.go
go test -failfast ./pkg/api/... -config "${{ secrets.CI_CONFIG_PATH }}"
go test -failfast ./pkg/api/... -config "${{ secrets.CI_CONFIG_PATH }}" --tags=integration



2 changes: 1 addition & 1 deletion .github/workflows/backend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
working-directory: ./backend
run: |
export TERM=xterm
go test `go list ./... | grep -v "pkg/consapi\|pkg/api\|internal/th\|internal/contracts\|pkg/commons/types\|pkg/commons/contracts\|cmd"` -coverprofile coverage.out -covermode atomic -race
go test `go list ./... | grep -v "pkg/consapi\|internal/th\|internal/contracts\|pkg/commons/types\|pkg/commons/contracts\|cmd"` -coverprofile coverage.out -covermode atomic -race
- name: coverage
working-directory: ./backend
Expand Down
2 changes: 1 addition & 1 deletion backend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ require (
github.com/gobitfly/eth.store v0.0.0-20241115163631-57eeb551a84e
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang-jwt/jwt/v4 v4.5.1
github.com/golang/protobuf v1.5.4
github.com/gomodule/redigo v1.9.2
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
Expand Down Expand Up @@ -175,7 +176,6 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.2.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
Expand Down
3 changes: 3 additions & 0 deletions backend/pkg/api/api_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build integration
// +build integration

package api_test

import (
Expand Down

0 comments on commit 04c99cd

Please sign in to comment.