diff --git a/.github/workflows/reusable-build-test-release.yml b/.github/workflows/reusable-build-test-release.yml index 875ca00f..0413d5f6 100644 --- a/.github/workflows/reusable-build-test-release.yml +++ b/.github/workflows/reusable-build-test-release.yml @@ -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" @@ -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' }}