Skip to content

Commit

Permalink
Use success failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kalverra committed Dec 19, 2024
1 parent a8a7486 commit 9cb2c16
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/flakeguard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,23 +385,23 @@ jobs:
echo "summary=$summary" >> $GITHUB_OUTPUT

- name: Upload All Test Results as Artifact
if: ${{ always() && fromJSON(steps.results.outputs.summary).total_tests > 0 }}
if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).total_tests > 0 }}
uses: actions/[email protected]
with:
path: ./flakeguard-report/all-test-results.json
name: all-test-results.json
retention-days: 90

- name: Upload Failed Test Results as Artifact
if: ${{ always() && fromJSON(steps.results.outputs.summary).failed_runs > 0 }}
if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).failed_runs > 0 }}
uses: actions/[email protected]
with:
path: ./flakeguard-report/failed-test-results.json
name: failed-test-results.json
retention-days: 90

- name: Upload Failed Test Results With Logs as Artifact
if: ${{ always() && fromJSON(steps.results.outputs.summary).failed_runs > 0 }}
if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).failed_runs > 0 }}
uses: actions/[email protected]
with:
path: ./flakeguard-report/failed-test-results-with-logs.json
Expand All @@ -410,7 +410,7 @@ jobs:

- name: Generate Flakeguard Reports
shell: bash
if: always()
if: success() || failure()
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
Expand Down Expand Up @@ -453,7 +453,7 @@ jobs:
fi

- name: Add Github Summary
if: always()
if: (success() || failure())
run: |
FILE_SIZE=$(wc -c < ./flakeguard-report/all-test-summary.md)
echo "File size: $FILE_SIZE bytes"
Expand All @@ -468,7 +468,7 @@ jobs:
fi
- name: Post comment on PR if flaky tests found
if: ${{ always() && fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }}
if: ${{ (success() || failure()) && fromJSON(steps.results.outputs.summary).flaky_tests > 0 && github.event_name == 'pull_request' }}
uses: actions/github-script@v7
continue-on-error: true
with:
Expand All @@ -485,7 +485,7 @@ jobs:
});
- name: Send Slack message for failed tests
if: ${{ always() && inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }}
if: ${{ (success() || failure()) && inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests > 0 }}
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
Expand Down Expand Up @@ -538,7 +538,7 @@ jobs:
- name: Send general Slack message
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
if: ${{ always() && inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests == 0 && fromJSON(steps.results.outputs.summary).total_tests > 0 }}
if: ${{ (success() || failure()) && inputs.slackNotificationAfterTestsChannelId != '' && fromJSON(steps.results.outputs.summary).flaky_tests == 0 && fromJSON(steps.results.outputs.summary).total_tests > 0 }}
id: slack
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
Expand Down

0 comments on commit 9cb2c16

Please sign in to comment.