diff --git a/.woodpecker.yml b/.woodpecker.yml index f3ad17e..c9576f3 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -14,12 +14,12 @@ pipeline: - go version - go install mvdan.cc/gofumpt@latest - "[ $(gofumpt -extra -l . | wc -l) != 0 ] && { echo 'code not formated'; exit 1; }" - - golangci-lint run --timeout 5m + - golangci-lint run --timeout 5m --build-tags integration test: image: golang:1.18 commands: - - go test codeberg.org/codeberg/pages/server/... + - go test -race codeberg.org/codeberg/pages/server/... build: image: golang:1.18 @@ -30,7 +30,7 @@ pipeline: image: golang:1.18 detach: true commands: - - go test -tags integration codeberg.org/codeberg/pages/integration/... + - go test -race -tags integration codeberg.org/codeberg/pages/integration/... environment: - ACME_API=https://acme.mock.directory - PAGES_DOMAIN=localhost.mock.directory diff --git a/Justfile b/Justfile index 2c64574..b96f1fa 100644 --- a/Justfile +++ b/Justfile @@ -13,7 +13,7 @@ build: lint: tool-golangci tool-gofumpt [ $(gofumpt -extra -l . | wc -l) != 0 ] && { echo 'code not formated'; exit 1; }; \ - golangci-lint run --timeout 5m + golangci-lint run --timeout 5m --build-tags integration tool-golangci: @hash golangci-lint> /dev/null 2>&1; if [ $? -ne 0 ]; then \ diff --git a/integration/get_test.go b/integration/get_test.go index e5fc279..3f2048e 100644 --- a/integration/get_test.go +++ b/integration/get_test.go @@ -1,3 +1,6 @@ +//go:build integration +// +build integration + package integration import ( diff --git a/integration/main_test.go b/integration/main_test.go index ee4d2ff..43f6792 100644 --- a/integration/main_test.go +++ b/integration/main_test.go @@ -1,3 +1,6 @@ +//go:build integration +// +build integration + package integration import ( @@ -23,11 +26,9 @@ func TestMain(m *testing.M) { log.Printf("=== TestMain: Server STOPED ==\n") }() - time.Sleep(30 * time.Second) + time.Sleep(20 * time.Second) - m.Run() - - os.Exit(0) + os.Exit(m.Run()) } func startServer(ctx context.Context) error {