-
Notifications
You must be signed in to change notification settings - Fork 1.8k
wip: Run less e2e matrix by default #9109
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
vdemeester
wants to merge
1
commit into
tektoncd:main
Choose a base branch
from
vdemeester:gh-workflow-on-demand
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
There are no files selected for viewing
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,160 @@ | ||||||
| name: Tekton Integration (Backcompat) | ||||||
|
|
||||||
| on: | ||||||
| issue_comment: | ||||||
| types: [created, edited] | ||||||
|
|
||||||
| permissions: | ||||||
| contents: read | ||||||
| pull-requests: read | ||||||
| checks: write | ||||||
|
|
||||||
| defaults: | ||||||
| run: | ||||||
| shell: bash | ||||||
|
|
||||||
| jobs: | ||||||
| run-if-requested: | ||||||
| if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/run-extra-tests') }} | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - name: Set PR variables | ||||||
| id: pr | ||||||
| uses: actions/github-script@60a0d83039c74a4aee5e5cbf49f72e2045aa4292 # v7.0.1 | ||||||
| with: | ||||||
| script: | | ||||||
| const pr = await github.rest.pulls.get({ | ||||||
| owner: context.repo.owner, | ||||||
| repo: context.repo.repo, | ||||||
| pull_number: context.issue.number | ||||||
| }); | ||||||
| core.setOutput('sha', pr.data.head.sha); | ||||||
| outputs: | ||||||
| sha: ${{ steps.pr.outputs.sha }} | ||||||
|
|
||||||
| backcompat-e2e: | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For clarity
Suggested change
|
||||||
| needs: [run-if-requested] | ||||||
| if: ${{ needs.run-if-requested.result == 'success' }} | ||||||
| concurrency: | ||||||
| group: ${{ github.workflow }}-${{ matrix.os }}-${{ matrix.k8s-name }}-${{ matrix.feature-flags }}-${{ github.event.issue.number }} | ||||||
| cancel-in-progress: true | ||||||
| name: e2e tests (backcompat) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For clarity
Suggested change
|
||||||
| runs-on: ${{ matrix.os }} | ||||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| os: | ||||||
| - ubuntu-latest | ||||||
| k8s-name: | ||||||
| - k8s-latest-minus-five # 1.29 | ||||||
| - k8s-latest-minus-four # 1.30 | ||||||
| - k8s-latest-minus-three # 1.31 | ||||||
| - k8s-latest-minus-two # 1.32 | ||||||
| - k8s-latest-minus-one # 1.33 | ||||||
| feature-flags: [stable] | ||||||
| include: | ||||||
| - k8s-name: k8s-latest-minus-five | ||||||
| k8s-version: v1.29.x | ||||||
| - k8s-name: k8s-latest-minus-four | ||||||
| k8s-version: v1.30.x | ||||||
| - k8s-name: k8s-latest-minus-three | ||||||
| k8s-version: v1.31.x | ||||||
| - k8s-name: k8s-latest-minus-two | ||||||
| k8s-version: v1.32.x | ||||||
| - k8s-name: k8s-latest-minus-one | ||||||
| k8s-version: v1.33.x | ||||||
| env: | ||||||
| KO_DOCKER_REPO: registry.local:5000/tekton | ||||||
| CLUSTER_DOMAIN: c${{ github.run_id }}.local | ||||||
| ARTIFACTS: ${{ github.workspace }}/artifacts | ||||||
| steps: | ||||||
| - name: Report tests check | ||||||
| uses: actions/github-script@60a0d83039c74a4aee5e5cbf49f72e2045aa4292 # v7.0.1 | ||||||
| id: check-run | ||||||
| with: | ||||||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||
| script: | | ||||||
| const check = await github.rest.checks.create({ | ||||||
| name: 'run tests', | ||||||
| head_sha: '${{ needs.run-if-requested.outputs.sha }}', | ||||||
| status: 'in_progress', | ||||||
| details_url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}', | ||||||
| ...context.repo | ||||||
| }) | ||||||
| return { id: check.data.id } | ||||||
|
|
||||||
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||||||
| with: | ||||||
| ref: ${{ needs.run-if-requested.outputs.sha }} | ||||||
| - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | ||||||
| with: | ||||||
| go-version-file: "go.mod" | ||||||
| - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 | ||||||
|
|
||||||
| - name: Install Dependencies | ||||||
| run: | | ||||||
| echo '::group:: install go-junit-report' | ||||||
| go install github.com/jstemmer/[email protected] | ||||||
| echo '::endgroup::' | ||||||
| echo '::group:: created required folders' | ||||||
| mkdir -p "${ARTIFACTS}" | ||||||
| echo '::endgroup::' | ||||||
| echo "${GOPATH}/bin" >> "$GITHUB_PATH" | ||||||
|
|
||||||
| - name: Run tests | ||||||
| run: | | ||||||
| export PATH="$(echo "$PATH" | sed -e 's/^\/bin://'):/bin" | ||||||
| export KO_DEFAULTPLATFORMS=linux/$(go env GOARCH) | ||||||
| ./hack/setup-kind.sh \ | ||||||
| --registry-url $(echo ${KO_DOCKER_REPO} | cut -d'/' -f 1) \ | ||||||
| --cluster-suffix c${{ github.run_id }}.local \ | ||||||
| --nodes 3 \ | ||||||
| --k8s-version ${{ matrix.k8s-version }} \ | ||||||
| --e2e-script ./test/e2e-tests.sh \ | ||||||
| --e2e-env ./test/e2e-tests-kind-${{ matrix.feature-flags }}.env | ||||||
|
|
||||||
| - name: Upload test results | ||||||
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | ||||||
| with: | ||||||
| name: extra-tests-${{ matrix.k8s-version }}-${{ matrix.feature-flags }} | ||||||
| path: ${{ env.ARTIFACTS }} | ||||||
|
|
||||||
| - uses: chainguard-dev/actions/kind-diag@6f4f4de7549514e7b659741b30f6476f245600dd # v1.5.3 | ||||||
| if: ${{ failure() }} | ||||||
| with: | ||||||
| artifact-name: extra-tests-${{ matrix.k8s-version }}-${{ matrix.feature-flags }}-logs | ||||||
|
|
||||||
| - name: Report tests check | ||||||
| if: success() || failure() | ||||||
| uses: actions/github-script@60a0d83039c74a4aee5e5cbf49f72e2045aa4292 # v7.0.1 | ||||||
| with: | ||||||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||||||
| script: | | ||||||
| const resp = await github.rest.checks.update({ | ||||||
| name: 'run tests', | ||||||
| check_run_id: ${{ fromJSON(steps.check-run.outputs.result).id }}, | ||||||
| head_sha: '${{ needs.run-if-requested.outputs.sha }}', | ||||||
| status: 'completed', | ||||||
| conclusion: '${{ steps.tests-step.outcome }}', | ||||||
| details_url: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}', | ||||||
| output: { | ||||||
| title: 'Run tests', | ||||||
| summary: 'Results: ${{ steps.tests-step.outcome }}\n\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' | ||||||
| }, | ||||||
| ...context.repo | ||||||
| }) | ||||||
| console.log(`Check run create response: ${resp.status}`) | ||||||
| console.log(`Check run URL: ${resp.data.url}`) | ||||||
| console.log(`Check run HTML: ${resp.data.html_url}`) | ||||||
|
|
||||||
| - name: Dump Artifacts | ||||||
| if: ${{ failure() }} | ||||||
| run: | | ||||||
| if [[ -d ${{ env.ARTIFACTS }} ]]; then | ||||||
| cd ${{ env.ARTIFACTS }} | ||||||
| for x in $(find . -type f); do | ||||||
| echo "::group:: artifact $x" | ||||||
| cat $x | ||||||
| echo '::endgroup::' | ||||||
| done | ||||||
| fi | ||||||
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.
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.
So this is a bit more efficient than slash command as it doesn't require to run a workflow if the comment doesn't contain
/run-extra-testsThere 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.
Does this circumvent rules regarding who can run/trigger tests?
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 think we should stick to one way of implementing slash commands.
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.
Maybe we could use a slash command to add a label, and check for the label in matrix - only run certain instances if the label is set.
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.
So the only reason I did not go with slash command was, aside from experimenting, that this approach doesn't consume "run" — aka it won't start a workflow unless the comment on the PR has this content. The slash command approaches runs on any comments on any PRs (or issues I think), which tends to be a lot (and sometimes it may take over some other workflows).
But in general I agree with you, we should stick to one way of implementing slash commands indeed.