Skip to content

Commit

Permalink
ci: updating condition
Browse files Browse the repository at this point in the history
  • Loading branch information
harshilgajera-crest committed Aug 20, 2024
1 parent 963aac5 commit 28d8a99
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions .github/workflows/reusable-build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,8 @@ jobs:
name: splunk ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }} ${{ env.TEST_TYPE }} test report
path: "${{ needs.setup.outputs.directory-path }}/test-results/*.xml"
reporter: java-junit
- name: Job summary
if: ${{ !cancelled() }}
- name: Parse JUnit XML
id: parse-junit
run: |
apt-get install -y libxml2-utils || true
junit_xml_path="${{ needs.setup.outputs.directory-path }}/test-results/*.xml"
Expand All @@ -1230,18 +1230,16 @@ jobs:
errors=$(xmllint --xpath 'sum(//testsuite/@errors)' $junit_xml_path)
skipped=$(xmllint --xpath 'sum(//testsuite/@skipped)' $junit_xml_path)
passed=$((total_tests - failures - errors - skipped))
# Check for failures or errors
if [ "$failures" -gt 0 ] || [ "$errors" -gt 0 ]; then
echo "## Summary for splunk ${{ matrix.splunk.version }}${{ secrets.OTHER_TA_REQUIRED_CONFIGS }} ${{ env.TEST_TYPE }} test report" >> $GITHUB_STEP_SUMMARY
echo "| Total Tests | Passed Tests | Failed Tests | Errored Tests | Skipped Tests |" >> $GITHUB_STEP_SUMMARY
echo "| ----------- | ------------ | ------------ | ------------- | ------------- |" >> $GITHUB_STEP_SUMMARY
echo "| $total_tests | $passed | $failures | $errors | $skipped |" >> $GITHUB_STEP_SUMMARY
echo "### Link to html test report: ${{steps.test_report.outputs.url_html}}" >> $GITHUB_STEP_SUMMARY
else
echo "All tests passed successfully. No failures or errors to report."
fi
echo "tests=$total_tests" >> $GITHUB_ENV
echo "passed=passed" >> $GITHUB_ENV
echo "failed=$failures" >> $GITHUB_ENV
echo "skipped=$skipped" >> $GITHUB_ENV
echo "errors=$errors" >> $GITHUB_ENV
- name: Add job summary
run: |
echo "| Job | Total Tests | Passed | Failed | skipped | errors" >> $GITHUB_STEP_SUMMARY
echo "| --- | ----------- | ------ | ------ | ------- | ------ |" >> $GITHUB_STEP_SUMMARY
echo "| ${{ matrix.splunk }} | ${{ env.tests }} | ${{ env.passed }} | ${{ env.failed }} | ${{ env.skipped }} | ${{ env.errors }} |" >> $GITHUB_STEP_SUMMARY
- name: pull diag from s3 bucket
if: ${{ failure() && steps.test_report.outputs.conclusion == 'failure' }}
Expand Down

0 comments on commit 28d8a99

Please sign in to comment.