Apache Nutch is an extensible and scalable web crawler
NUTCH-3143 GitHub workflow does not run all unit tests (#889)
Lewis John McGibbney7c5a529dc372
diff --git a/.github/workflows/junit-report.yml b/.github/workflows/junit-report.ymlindex 23a251a58..06be656a9 100644--- a/.github/workflows/junit-report.yml+++ b/.github/workflows/junit-report.yml@@ -31,48 +31,23 @@ jobs:name: junit-test-results-ubuntu-latestworkflow: master-build.ymlrun_id: ${{ github.event.workflow_run.id }}- path: ./results-ubuntucontinue-on-error: true- - name: Download Test Report (macOS)- uses: dawidd6/action-download-artifact@v11- with:- name: junit-test-results-macos-latest- workflow: master-build.yml- run_id: ${{ github.event.workflow_run.id }}- path: ./results-macos- continue-on-error: true- - name: Debug XML files- if: always()- run: |- echo "=== Listing downloaded artifacts ==="- find ./results-ubuntu ./results-macos -name "TEST-*.xml" 2>/dev/null | head -20 || echo "No files found"- echo ""- echo "=== TestCommonCrawlDataDumper.xml (macOS) ==="- cat ./results-macos/test/TEST-org.apache.nutch.tools.TestCommonCrawlDataDumper.xml 2>/dev/null || echo "File not found"- echo ""- echo "=== TestCommonCrawlDataDumper.xml (Ubuntu) ==="- cat ./results-ubuntu/test/TEST-org.apache.nutch.tools.TestCommonCrawlDataDumper.xml 2>/dev/null || echo "File not found"- echo ""- echo "=== TestPrefixStringMatcher.xml (Ubuntu) ==="- cat ./results-ubuntu/test/TEST-org.apache.nutch.util.TestPrefixStringMatcher.xml 2>/dev/null || echo "File not found"- echo ""- echo "=== TestPrefixStringMatcher.xml (macOS) ==="- cat ./results-macos/test/TEST-org.apache.nutch.util.TestPrefixStringMatcher.xml 2>/dev/null || echo "File not found"- name: Publish Test Reportuses: mikepenz/action-junit-report@v5with:report_paths: |-- ./results-ubuntu/**/TEST-*.xml- ./results-macos/**/TEST-*.xml+ ./test/TEST-*.xml+ ./**/test/TEST-*.xmlcheck_name: |-JUnit Test ReportJUnit Test Report Pluginscommit: ${{ github.event.workflow_run.head_sha }}fail_on_failure: false- fail_on_parse_error: false+ fail_on_parse_error: truerequire_tests: truerequire_passed_tests: trueinclude_passed: false+ include_skipped: truecheck_annotations: trueannotate_notice: truejob_summary: truediff --git a/.github/workflows/master-build.yml b/.github/workflows/master-build.ymlindex 153c09b93..d73bb3a69 100644--- a/.github/workflows/master-build.yml+++ b/.github/workflows/master-build.yml@@ -120,13 +120,20 @@ jobs:- name: test pluginsif: ${{ steps.filter.outputs.plugins == 'true' && steps.filter.outputs.core == 'false' && steps.filter.outputs.buildconf == 'false' }}run: ant clean test-plugins -buildfile build.xml- # fallback: run all tests if no specific filter matched (e.g., docs-only changes)- - name: test all (fallback)- if: ${{ steps.filter.outputs.buildconf == 'false' && steps.filter.outputs.core == 'false' && steps.filter.outputs.plugins == 'false' }}- run: ant clean test -buildfile build.xml+ - name: Check for test results+ id: check_tests+ if: always() && matrix.os == 'ubuntu-latest'+ run: |+ shopt -s globstar nullglob+ files=(./build/test/TEST-*.xml ./build/**/test/TEST-*.xml)+ if [ ${#files[@]} -gt 0 ]; then+ echo "has_results=true" >> $GITHUB_OUTPUT+ else+ echo "has_results=false" >> $GITHUB_OUTPUT+ fi- name: Upload Test Reportuses: actions/upload-artifact@v4- if: always()+ if: always() && matrix.os == 'ubuntu-latest' && steps.check_tests.outputs.has_results == 'true'with:name: junit-test-results-${{ matrix.os }}path: |