Skip to content

Commit 500906e

Browse files
committed
test: add api unit tests to test workflow, exclude integration tests
1 parent 6f40d13 commit 500906e

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

.github/workflows/backend-integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
working-directory: backend
3636
run:
3737
go install github.com/swaggo/swag/cmd/swag@latest && swag init --ot json -o ./pkg/api/docs -d ./pkg/api/ -g ./handlers/public.go
38-
go test -failfast ./pkg/api/... -config "${{ secrets.CI_CONFIG_PATH }}"
38+
go test -failfast ./pkg/api/... -config "${{ secrets.CI_CONFIG_PATH }}" --tags=integration
3939

4040

4141

.github/workflows/backend-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
working-directory: ./backend
2323
run: |
2424
export TERM=xterm
25-
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
25+
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
2626
2727
- name: coverage
2828
working-directory: ./backend

backend/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ require (
3232
github.com/gobitfly/eth.store v0.0.0-20241115163631-57eeb551a84e
3333
github.com/golang-jwt/jwt v3.2.2+incompatible
3434
github.com/golang-jwt/jwt/v4 v4.5.1
35+
github.com/golang/protobuf v1.5.4
3536
github.com/gomodule/redigo v1.9.2
3637
github.com/google/go-cmp v0.6.0
3738
github.com/google/uuid v1.6.0
@@ -175,7 +176,6 @@ require (
175176
github.com/gogo/protobuf v1.3.2 // indirect
176177
github.com/golang/glog v1.2.2 // indirect
177178
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
178-
github.com/golang/protobuf v1.5.4 // indirect
179179
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
180180
github.com/google/btree v1.1.2 // indirect
181181
github.com/google/go-querystring v1.1.0 // indirect

backend/pkg/api/api_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//go:build integration
2+
// +build integration
3+
14
package api_test
25

36
import (

0 commit comments

Comments
 (0)