Skip to content

Commit 5de29e9

Browse files
committed
ci: run e2e tests in GitLab CI
1 parent 2248a1d commit 5de29e9

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

.gitlab-ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,12 @@ test:unit:
5656
coverage_format: cobertura
5757
path: coverage.xml
5858
coverage: "/coverage: \\d+.\\d+% of statements/"
59+
60+
test:e2e:
61+
stage: test
62+
image: golang:1.24
63+
script:
64+
- export HCLOUD_TOKEN=$(sh hack/get-tmp-hcloud-token.sh)
65+
- go test -tags e2e -coverpkg=./... -coverprofile=coverage.txt -v -race ./test/e2e
66+
variables:
67+
CERT_DOMAIN: hc-integrations-test.de

hack/get-tmp-hcloud-token.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
error() {
6+
echo >&2 "error: $*"
7+
exit 1
8+
}
9+
10+
TPS_URL="https://tps.hc-integrations.de"
11+
12+
curl \
13+
--silent \
14+
--fail-with-body \
15+
--request "POST" \
16+
--user-agent "tps-client/unknown" \
17+
--header "Authorization: Bearer $TPS_TOKEN" \
18+
"$TPS_URL" || error "could not generate temporary token!"

0 commit comments

Comments
 (0)