Skip to content

Commit 318bc52

Browse files
Refactor integration E2E tests
* General cleanup of the integration tests Golang code. Move the `e2e.go` codebase into its own package and separate files. * Reduce the overall log spam from the integration tests output. * Add final GitHub workflow step that stops GARM server, and does the GitHub cleanup of any orphaned resources. * Add `TODO` to implement cleanup of the orphaned GitHub webhooks. This is useful, if the uninstall of the webhooks failed. * Add `TODO` for extra missing checks on the GitHub webhooks install / uninstall logic. Signed-off-by: Ionut Balutoiu <[email protected]>
1 parent 789644c commit 318bc52

15 files changed

+1473
-1547
lines changed

.github/workflows/integration-tests.yml

+16-5
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,9 @@ jobs:
6161
run: |
6262
set -o pipefail
6363
set -o errexit
64-
go run ./test/integration/e2e.go 2>&1 | tee /artifacts-logs/e2e.log
64+
go run ./test/integration/main.go 2>&1 | tee /artifacts-logs/e2e.log
6565
env:
6666
GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }}
67-
GARM_USERNAME: admin
68-
GARM_FULLNAME: Local GARM Admin
69-
GARM_EMAIL: [email protected]
70-
GARM_NAME: local_garm
7167
ORG_NAME: gsamfira
7268
REPO_NAME: garm-testing
7369
CREDENTIALS_NAME: test-garm-creds
@@ -86,3 +82,18 @@ jobs:
8682
with:
8783
name: garm-logs
8884
path: /artifacts-logs
85+
86+
- name: Cleanup orphan GARM resources via GitHub API
87+
if: always()
88+
run: |
89+
set -o pipefail
90+
set -o errexit
91+
92+
sudo systemctl stop garm
93+
94+
go run ./test/integration/gh_cleanup/main.go
95+
env:
96+
GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }}
97+
ORG_NAME: gsamfira
98+
REPO_NAME: garm-testing
99+
GH_TOKEN: ${{ secrets.GH_OAUTH_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*.dll
55
*.so
66
*.dylib
7+
*.DS_Store
78

89
# Test binary, built with `go test -c`
910
*.test

0 commit comments

Comments
 (0)