Skip to content

Commit

Permalink
chore(ci): deck integration tests fail CI on test failure
Browse files Browse the repository at this point in the history
when deck integration tests fail, a request for changes was created in
the PR. This was often ignored: let's fail CI instead.
  • Loading branch information
samugi committed Aug 20, 2024
1 parent c29db18 commit c2cfc82
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/deck-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ jobs:

- name: Tests
id: deck_tests
continue-on-error: true
env:
KONG_TEST_PG_DATABASE: kong
KONG_TEST_PG_USER: kong
Expand All @@ -76,39 +75,3 @@ jobs:
mkdir $TEST_RESULTS_XML_OUTPUT
source ${{ env.BUILD_ROOT }}/kong-dev-venv.sh
bin/busted spec/06-third-party/01-deck -o hjtest -Xoutput $(realpath $TEST_RESULTS_XML_OUTPUT)/report.xml -v
- name: Find review if exists
id: find-review
uses: actions/github-script@v7
with:
result-encoding: json
retries: 3
script: |
const reviews = await github.paginate(github.rest.pulls.listReviews, {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
});
const botReview = reviews.reverse().find(review => {
return review.user.login === "github-actions[bot]" && review.body.includes("decK integration tests");
});
if (botReview && botReview.state === "CHANGES_REQUESTED") {
return { "review_id": botReview.id };
} else {
return { "review_id": "" };
}
- name: Request changes if failures are detected
if: ${{ fromJson(steps.find-review.outputs.result).review_id == '' && steps.deck_tests.outcome != 'success' }}
uses: actions/github-script@v7
with:
script: |
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
event: 'REQUEST_CHANGES',
body: `## decK integration tests\n\n:warning: failure detected. Please check [the workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`
})

1 comment on commit c2cfc82

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:c2cfc82d6adbdfb1d3b908ff6f211fd3fd2fa50a
Artifacts available https://github.com/Kong/kong/actions/runs/10474428386

Please sign in to comment.