-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
58 lines (43 loc) · 2.37 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
TEST_FLAGS?=
TEST_PATTERN?=./...
all: test
tidy:
go mod tidy -compat=1.22
fmt:
go fmt ./...
vet:
go vet ./...
GIT_PROVIDER_ORGANIZATION ?= fluxcd-testing
GIT_PROVIDER_USER ?= fluxcd-gitprovider-bot
# GitLab specific testing variables
GITLAB_VERSION ?= 16.0.5@sha256:526942e9ae6f3b4f0b8ff16a07535541dfc2ca58211660c3c0c9b8c0864bba2c
GITLAB_TOKEN ?= glpat-ACCTEST1234567890123
GITLAB_BASE_URL ?= http://127.0.0.1:9042
GITLAB_TEST_REPO_NAME ?= fluxcd-testing-repo
GITLAB_TEST_SUBGROUP ?= fluxcd-testing-sub-group
GITLAB_TEST_TEAM_NAME ?= fluxcd-testing-2
# Gitea specific testing variables
GITEA_BASE_URL ?= http://127.0.0.1:3000
GITEA_TOKEN ?=
GITEA_TEST_TEAM_NAME ?= fluxcd-testing-2
GITEA_VERSION ?=
start-provider-instances-gitlab:
GITLAB_TOKEN=$(GITLAB_TOKEN) GIT_PROVIDER_USER=$(GIT_PROVIDER_USER) GIT_PROVIDER_ORGANIZATION=$(GIT_PROVIDER_ORGANIZATION) GITLAB_TEST_REPO_NAME=$(GITLAB_TEST_REPO_NAME) GITLAB_TEST_SUBGROUP=$(GITLAB_TEST_SUBGROUP) GITLAB_TEST_TEAM_NAME=$(GITLAB_TEST_TEAM_NAME) GITLAB_VERSION=$(GITLAB_VERSION) docker compose up -d gitlab
GITLAB_BASE_URL=$(GITLAB_BASE_URL) GITLAB_TOKEN=$(GITLAB_TOKEN) ./tests/gitlab/await-healthy.sh
start-provider-instances-gitea:
GITEA_VERSION=$(GITEA_VERSION) GITEA_TEST_TEAM_NAME=$(GITEA_TEST_TEAM_NAME) GIT_PROVIDER_ORGANIZATION=$(GIT_PROVIDER_ORGANIZATION) GITEA_USER=$(GIT_PROVIDER_USER) docker compose up -d gitea
GITEA_USER=$(GIT_PROVIDER_USER) GITEA_BASE_URL=$(GITEA_BASE_URL) ./tests/gitea/await-healthy.sh
stop-provider-instances:
docker compose down --volumes
test: tidy fmt vet
go test ${TEST_FLAGS} -race -coverprofile=coverage.txt -covermode=atomic ${TEST_PATTERN}
test-e2e-github: tidy fmt vet
go test ${TEST_FLAGS} -race -coverprofile=coverage.txt -covermode=atomic -tags=e2e ./github/...
test-e2e-gitlab: tidy fmt vet
GITLAB_BASE_URL=$(GITLAB_BASE_URL) GITLAB_TOKEN=$(GITLAB_TOKEN) go test ${TEST_FLAGS} -race -coverprofile=coverage.txt -covermode=atomic -tags=e2e ./gitlab/...
test-e2e-stash: tidy fmt vet
go test ${TEST_FLAGS} -race -coverprofile=coverage.txt -covermode=atomic -tags=e2e ./stash/...
test-e2e-gitea: tidy fmt vet
GITEA_BASE_URL=$(GITEA_BASE_URL) GITEA_TOKEN=$(GITEA_TOKEN) GITEA_TEST_TEAM_NAME=$(GITEA_TEST_TEAM_NAME) \
GIT_PROVIDER_ORGANIZATION=$(GIT_PROVIDER_ORGANIZATION) GITEA_USER=$(GIT_PROVIDER_USER) \
go test ${TEST_FLAGS} -race -coverprofile=coverage.txt -covermode=atomic -tags=e2e ./gitea/...