This commit is contained in:
6543 2022-06-10 20:01:00 +02:00
parent 50df84eec9
commit 0efadb6344
4 changed files with 12 additions and 8 deletions

View file

@ -14,12 +14,12 @@ pipeline:
- go version - go version
- go install mvdan.cc/gofumpt@latest - go install mvdan.cc/gofumpt@latest
- "[ $(gofumpt -extra -l . | wc -l) != 0 ] && { echo 'code not formated'; exit 1; }" - "[ $(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: test:
image: golang:1.18 image: golang:1.18
commands: commands:
- go test codeberg.org/codeberg/pages/server/... - go test -race codeberg.org/codeberg/pages/server/...
build: build:
image: golang:1.18 image: golang:1.18
@ -30,7 +30,7 @@ pipeline:
image: golang:1.18 image: golang:1.18
detach: true detach: true
commands: commands:
- go test -tags integration codeberg.org/codeberg/pages/integration/... - go test -race -tags integration codeberg.org/codeberg/pages/integration/...
environment: environment:
- ACME_API=https://acme.mock.directory - ACME_API=https://acme.mock.directory
- PAGES_DOMAIN=localhost.mock.directory - PAGES_DOMAIN=localhost.mock.directory

View file

@ -13,7 +13,7 @@ build:
lint: tool-golangci tool-gofumpt lint: tool-golangci tool-gofumpt
[ $(gofumpt -extra -l . | wc -l) != 0 ] && { echo 'code not formated'; exit 1; }; \ [ $(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: tool-golangci:
@hash golangci-lint> /dev/null 2>&1; if [ $? -ne 0 ]; then \ @hash golangci-lint> /dev/null 2>&1; if [ $? -ne 0 ]; then \

View file

@ -1,3 +1,6 @@
//go:build integration
// +build integration
package integration package integration
import ( import (

View file

@ -1,3 +1,6 @@
//go:build integration
// +build integration
package integration package integration
import ( import (
@ -23,11 +26,9 @@ func TestMain(m *testing.M) {
log.Printf("=== TestMain: Server STOPED ==\n") log.Printf("=== TestMain: Server STOPED ==\n")
}() }()
time.Sleep(30 * time.Second) time.Sleep(20 * time.Second)
m.Run() os.Exit(m.Run())
os.Exit(0)
} }
func startServer(ctx context.Context) error { func startServer(ctx context.Context) error {