From 4642d98f2e44b5187eaa4448c3be5656fc3faad8 Mon Sep 17 00:00:00 2001 From: Anbraten Date: Tue, 7 Dec 2021 01:13:31 +0100 Subject: [PATCH] improve tests (#562) --- .woodpecker/test.yml | 36 ++++++++++++++++++------------------ Makefile | 6 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index 271cc1a27..00653cf08 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -10,30 +10,30 @@ pipeline: group: test commands: - make lint + when: + path: + include: + - "vendor/**" + - "go.mod" + - "go.sum" + - "**/*.go" + - ".golangci.yml" - agent: + test: image: golang:1.16 group: test commands: - make test-agent - - server: - image: golang:1.16 - group: test - commands: - make test-server - - cli: - image: golang:1.16 - group: test - commands: - make test-cli - - lib: - image: golang:1.16 - group: test - commands: - make test-lib + when: + path: + include: + - "vendor/**" + - "go.mod" + - "go.sum" + - "**/*.go" sqlite: image: golang:1.16 @@ -62,13 +62,13 @@ pipeline: - make test-server-datastore services: - postgres: + service-postgres: image: postgres:9.6 ports: ["5432"] environment: - POSTGRES_USER=postgres - POSTGRES_HOST_AUTH_METHOD=trust - mysql: + service-mysql: image: mysql:5.6.27 ports: ["3306"] environment: diff --git a/Makefile b/Makefile index 996f2ca5e..9ac774032 100644 --- a/Makefile +++ b/Makefile @@ -56,12 +56,12 @@ test-agent: test-server: $(DOCKER_RUN) go test -race -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/server $(shell go list github.com/woodpecker-ci/woodpecker/server/... | grep -v '/store') -test-server-datastore: - $(DOCKER_RUN) go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/... - test-cli: $(DOCKER_RUN) go test -race -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/cli github.com/woodpecker-ci/woodpecker/cli/... +test-server-datastore: + $(DOCKER_RUN) go test -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/... + test-frontend: frontend-dependencies (cd web/; yarn run lint) (cd web/; yarn run formatcheck)