Test GitHub runner developer debugging sessions - allanrogerr/public GitHub Wiki
See sample branch https://github.com/miniohq/aistor-operator/tree/debug-helm-kms-tests
1.- See sample patch below. Modify .github/workflows/builds.yml and .github/workflows/tests-integration.yml in a similar way.
Create a branch e.g. debug-helm-kms-tests
Summary:
- use
workflow_dispatch:instead ofpull_request: - use array of specific tests (there may be a less repetitive way of using the vars)
- remove
prepstep and references - remove other test lists e.g.
tests-addonsandtests-openshift
Note: Use your assigned runner e.g. self-hosted-dev-1-1
2.- Set the miniohq remote e.g.
git remote set-url origin https://allanrogerr:<token>@github.com/miniohq/aistor-operator.git
3.- Push git push
4.- Using the gh binary, run the following. Use your own branch.
gh workflow run .github/workflows/builds.yml --ref debug-helm-kms-tests
Subject: [PATCH] Test GitHub runner developer testing
---
Index: .github/workflows/builds.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml
--- a/.github/workflows/builds.yml (revision 4b8d58ce261942e106d796aff63f951978b74fa7)
+++ b/.github/workflows/builds.yml (revision d9fb1104417188c0667d88ecdd5d03e2c2f6f1ee)
@@ -2,8 +2,7 @@
name: Integration Tests
on:
- pull_request:
- branches: [master]
+ workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
@@ -192,66 +191,13 @@
name: docker-${{ matrix.sidecar }}-sidecar
path: ./tmp/${{ matrix.sidecar }}-sidecar-${{ github.sha }}.tar
- prep:
- name: Determine tests
- timeout-minutes: 5
- runs-on: self-hosted
- outputs:
- tests_addons: ${{ steps.testResult.outputs.tests_addons }}
- tests_integration: ${{ steps.testResult.outputs.tests_integration }}
- tests_openshift: ${{ steps.testResult.outputs.tests_openshift }}
- steps:
- - name: Checkout source
- uses: actions/checkout@v4
- - name: Determine tests
- id: testResult
- run: |
- # Using a regex is much faster compared to `go test -list`
- TESTS_JSON_ADDONS=$(cat integrationtests/addons/*_test.go | grep '^func Test[a-zA-Z0-9_]*\s*(t\s.testing.T)' | sed -n 's/.*\(Test[a-zA-Z0-9_]*\).*/\1/p' | sed s/^Test//g | jq -R -s -c 'split("\n")[:-1]')
- echo Addons tests: $TESTS_JSON_ADDONS
- echo "tests_addons=$TESTS_JSON_ADDONS" >> $GITHUB_OUTPUT
-
- TESTS_JSON_INTEGRATION=$(cat integrationtests/*_test.go | grep '^func Test[a-zA-Z0-9_]*InKind\s*(t\s.testing.T)' | sed -n 's/.*\(Test[a-zA-Z0-9_]*\).*/\1/p' | sed s/^Test//g | jq -R -s -c 'split("\n")[:-1]')
- echo Integration tests: $TESTS_JSON_INTEGRATION
- echo "tests_integration=$TESTS_JSON_INTEGRATION" >> $GITHUB_OUTPUT
-
- TESTS_JSON_OPENSHIFT=$(cat integrationtests/*_test.go | grep '^func Test[a-zA-Z0-9_]*InCRC\s*(t\s.testing.T)' | sed -n 's/.*\(Test[a-zA-Z0-9_]*\).*/\1/p' | sed s/^Test//g | jq -R -s -c 'split("\n")[:-1]')
- echo Openshift tests: $TESTS_JSON_OPENSHIFT
- echo "tests_openshift=$TESTS_JSON_OPENSHIFT" >> $GITHUB_OUTPUT
-
- tests-addons:
- needs:
- - build-operator
- - build-sidecars
- - prep
- uses: ./.github/workflows/tests-addons.yml
- with:
- tests: ${{ needs.prep.outputs.tests_addons }}
- secrets: inherit
-
tests-integration:
needs:
- build-operator
- build-sidecars
- - prep
- list-sidecars
uses: ./.github/workflows/tests-integration.yml
with:
tests: ${{ needs.prep.outputs.tests_integration }}
sidecars: ${{ needs.list-sidecars.outputs.sidecars }}
secrets: inherit
-
- tests-openshift:
- needs:
- - build-operator
- - build-sidecars
- - build-catalog
- - prep
- - list-bundles
- uses: ./.github/workflows/tests-openshift.yml
- with:
- tests: ${{ needs.prep.outputs.tests_openshift }}
- bundles: ${{ needs.list-bundles.outputs.bundles }}
- github_short: ${{ needs.list-bundles.outputs.github_short }}
- aistor_test_ns: ${{ needs.build-catalog.outputs.aistor_test_ns }}
- secrets: inherit
Index: .github/workflows/tests-integration.yml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml
--- a/.github/workflows/tests-integration.yml (revision 4b8d58ce261942e106d796aff63f951978b74fa7)
+++ b/.github/workflows/tests-integration.yml (revision d9fb1104417188c0667d88ecdd5d03e2c2f6f1ee)
@@ -27,12 +27,49 @@
timeout-minutes: 30
strategy:
fail-fast: false
- max-parallel: 16
matrix:
- tests: ${{ fromJson(inputs.tests) }}
- go-version: [1.24.0] # Same as 'go x.y.z' in go.mod
- os: [self-hosted]
- kind-node-ver: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && fromJson('[1.29, 1.30, 1.31, 1.32]') || fromJson('[1.32]') }}
+ include:
+ - tests: TestHelmKMSInKind
+ runner: self-hosted-dev-1-1
+ go-version: 1.24.0
+ os: self-hosted
+ kind-node-ver: 1.32
+ - tests: TestHelmKMSWithNoHSMsInKind
+ runner: self-hosted-dev-1-2
+ go-version: 1.24.0
+ os: self-hosted
+ kind-node-ver: 1.32
+ - tests: TestHelmAddStaticKeyHSMLaterInKind
+ runner: self-hosted-dev-1-3
+ go-version: 1.24.0
+ os: self-hosted
+ kind-node-ver: 1.32
+ - tests: TestHelmAddMinKMSasHSMLaterInKind
+ runner: self-hosted-dev-1-4
+ go-version: 1.24.0
+ os: self-hosted
+ kind-node-ver: 1.32
+ - tests: TestHelmVaultasHSMWithExternalCAInKind
+ runner: self-hosted-dev-2-1
+ go-version: 1.24.0
+ os: self-hosted
+ kind-node-ver: 1.32
+ - tests: TestHelmKMSSetCustomAPIKeyInKind
+ runner: self-hosted-dev-2-2
+ go-version: 1.24.0
+ os: self-hosted
+ kind-node-ver: 1.32
+ - tests: TestHelmKMSAPIKeyDerivedFromSoftHSMInKind
+ runner: self-hosted-dev-2-3
+ go-version: 1.24.0
+ os: self-hosted
+ kind-node-ver: 1.32
+# - tests: XYZ # Uncomment and add more tests as needed
+# runner: self-hosted-dev-2-4
+# go-version: 1.24.0
+# os: self-hosted
+# kind-node-ver: 1.32
+ max-parallel: 16
steps:
- name: Checkout source
uses: actions/checkout@v4