-
Notifications
You must be signed in to change notification settings - Fork 10
sync CCM<>CSI test cluster setup, add integration tests on schedule #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2aba7e7
sync CCM<>CSI test cluster setup, add integration tests on schedule
mweibel 477f5de
retry getVolumeInfo: TestPod_Single_Bulk_Luks_Volume sometimes takes …
mweibel 205fa1d
address review comments
mweibel 0b6184a
add debug info
mweibel 1e1e5b1
handle image pull policy and restart
mweibel 244cc1b
try improving integration test reliability
mweibel 08b687c
fix pull policy: local build should not use always if building on the…
mweibel f42659f
fix go version to use for building
mweibel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| name: CSI Integration Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| pull_request: | ||
|
|
||
| # Allow to run this workflow manually from the Actions tab | ||
| workflow_dispatch: | ||
|
|
||
| # Run this regularly, to get integration tests results against new | ||
| # Kubernetes releases. | ||
| schedule: | ||
| - cron: '15 3 * * *' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test-matrix: | ||
| name: "Get Kubernetes Releases" | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: "Generate Test Matrix" | ||
| id: list | ||
| run: 'echo "tests=$(helpers/test-matrix)" >> $GITHUB_OUTPUT' | ||
|
|
||
| outputs: | ||
| tests: ${{ steps.list.outputs.tests }} | ||
|
|
||
| build-image: | ||
| name: "Build Container Image" | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Evaluate image name | ||
| run: 'helpers/image-from-ref >> $GITHUB_ENV' | ||
|
|
||
| - name: Extract version | ||
| run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV | ||
|
|
||
| - name: Build image | ||
| run: make build | ||
|
|
||
| - name: Export image | ||
| run: 'docker image save "$IMAGE" -o image.tar' | ||
|
|
||
| - name: Store hash | ||
| run: 'shasum -a 256 image.tar | tee image.tar.sha256' | ||
|
|
||
| - name: Store image | ||
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | ||
| with: | ||
| name: tested-image | ||
| path: | | ||
| image.tar | ||
| image.tar.sha256 | ||
| retention-days: 30d | ||
|
|
||
| check-csi-integration: | ||
| # Preflight: verify the CLOUDSCALE_API_TOKEN at step-level and set an output | ||
| # so the integration job can be skipped. | ||
| # | ||
| # GitHub Actions limitations motivating this: | ||
| # - `secrets` are NOT available in `jobs.<id>.if` (job-level `if`), so you cannot | ||
| # directly gate/skip a job by testing a secret there. | ||
| name: Check CSI Integration Configuration | ||
| runs-on: ubuntu-latest | ||
|
|
||
| outputs: | ||
| integration-enabled: ${{ steps.check.outputs.enabled }} | ||
|
|
||
| steps: | ||
| - id: check | ||
| name: Verify CLOUDSCALE_API_TOKEN is present | ||
| env: | ||
| CLOUDSCALE_API_TOKEN: ${{ secrets.CLOUDSCALE_API_TOKEN }} | ||
| run: | | ||
| if [ -n "$CLOUDSCALE_API_TOKEN" ]; then | ||
| echo "enabled=true" >> $GITHUB_OUTPUT | ||
| echo "CLOUDSCALE_API_TOKEN found — integration will run." | ||
| else | ||
| echo "enabled=false" >> $GITHUB_OUTPUT | ||
| echo "CLOUDSCALE_API_TOKEN not configured — skipping integration." | ||
| fi | ||
|
|
||
| integration: | ||
| name: "Kubernetes ${{ matrix.kubernetes }}" | ||
| runs-on: ubuntu-latest | ||
|
|
||
| needs: | ||
| - test-matrix | ||
| - build-image | ||
| - check-csi-integration | ||
| if: needs.check-csi-integration.outputs.integration-enabled == 'true' | ||
|
|
||
| strategy: | ||
| fail-fast: false | ||
| max-parallel: 1 | ||
| matrix: | ||
| include: "${{ fromJson(needs.test-matrix.outputs.tests) }}" | ||
|
|
||
| env: | ||
| CLOUDSCALE_API_TOKEN: ${{ secrets.CLOUDSCALE_API_TOKEN }} | ||
| KUBERNETES: '${{ matrix.kubernetes }}' | ||
| SUBNET: '${{ matrix.subnet }}' | ||
| CLUSTER_PREFIX: '${{ matrix.cluster_prefix }}' | ||
| IMAGE_SOURCE: import | ||
|
|
||
| # Prevent integration tests from running in parallel. Ideally this should | ||
| # be seuqential, but that won't work due to the following issue: | ||
| # | ||
| # https://github.com/orgs/community/discussions/5435 | ||
| # | ||
| # Instead we ensure that only one integration test per supported version | ||
| # is run at any given time. | ||
| concurrency: | ||
| group: integration-${{ matrix.kubernetes }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Load image | ||
| uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 | ||
| with: | ||
| name: tested-image | ||
|
|
||
| - name: Validate hash | ||
| run: 'shasum --check image.tar.sha256' | ||
|
|
||
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Setup Helm | ||
| uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 | ||
| with: | ||
| version: v4.2.4 | ||
|
|
||
| - name: Evaluate image name | ||
| run: 'helpers/image-from-ref >> $GITHUB_ENV' | ||
|
|
||
| - name: Cleanup Leftovers | ||
| if: always() | ||
| run: helpers/cleanup | ||
|
|
||
| - name: Create Test Cluster | ||
| run: helpers/run-in-test-cluster | ||
|
|
||
| - name: Run Integration Tests | ||
| run: TESTARGS="-race" make test-integration | ||
|
|
||
| - name: Wait For Kubernetes-Internal Cleanup | ||
| if: always() | ||
| run: sleep 30 | ||
|
|
||
| - name: Destroy Test Cluster | ||
| if: always() | ||
| run: helpers/cleanup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,3 +7,5 @@ charts/csi-cloudscale/charts | |
| cmd/cloudscale-csi-plugin/cloudscale-csi-plugin | ||
| k8test/ | ||
| bin/ | ||
|
|
||
| __pycache__/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest deleting this line. it will then show up for developers and they can remove it.