Skip to content

Commit

Permalink
Refactor integration E2E tests
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Ionut Balutoiu committed Aug 24, 2023
1 parent 789644c commit 318bc52
Show file tree
Hide file tree
Showing 15 changed files with 1,473 additions and 1,547 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,9 @@ jobs:
run: |
set -o pipefail
set -o errexit
go run ./test/integration/e2e.go 2>&1 | tee /artifacts-logs/e2e.log
go run ./test/integration/main.go 2>&1 | tee /artifacts-logs/e2e.log
env:
GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }}
GARM_USERNAME: admin
GARM_FULLNAME: Local GARM Admin
GARM_EMAIL: [email protected]
GARM_NAME: local_garm
ORG_NAME: gsamfira
REPO_NAME: garm-testing
CREDENTIALS_NAME: test-garm-creds
Expand All @@ -86,3 +82,18 @@ jobs:
with:
name: garm-logs
path: /artifacts-logs

- name: Cleanup orphan GARM resources via GitHub API
if: always()
run: |
set -o pipefail
set -o errexit
sudo systemctl stop garm
go run ./test/integration/gh_cleanup/main.go
env:
GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }}
ORG_NAME: gsamfira
REPO_NAME: garm-testing
GH_TOKEN: ${{ secrets.GH_OAUTH_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.dll
*.so
*.dylib
*.DS_Store

# Test binary, built with `go test -c`
*.test
Expand Down
Loading

0 comments on commit 318bc52

Please sign in to comment.