diff --git a/.github/actions/merge-test-reports/action.yml b/.github/actions/merge-test-reports/action.yml deleted file mode 100644 index 154e834383c45..0000000000000 --- a/.github/actions/merge-test-reports/action.yml +++ /dev/null @@ -1,44 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -name: Merge test reports to a single file -description: Merges junit test reports to a single file -inputs: - summary_title: - description: 'The title for the summary' - required: false -runs: - using: composite - steps: - - run: | - if ls test-reports/*.xml 2>/dev/null; then - echo '::group::Installing tooling...' - # this requires "runs-on: ubuntu-20.04" since junitparser package is not available in previous Ubuntu version - sudo apt-get -y install xmlstarlet junitparser >/dev/null - echo '::endgroup::' - echo '::group::Parsing and merging test reports...' - junitparser merge test-reports/*.xml merged-test-report.xml || true - echo '::endgroup::' - if [[ -f merged-test-report.xml && -n "${{ inputs.summary_title }}" ]]; then - xmlstarlet sel -T -t -m /testsuites -o "::warning::${{ inputs.summary_title }} " -v '@tests' -o ' tests, ' -v '@failures' -o ' failures, ' -v '@errors' -o ' errors, ' -v '@skipped' -o ' skipped, duration ' -v 'number(@time)' -o 's' merged-test-report.xml - fi - else - echo 'No test-reports/*.xml files found.' - fi - shell: bash diff --git a/.github/workflows/pulsar-ci-test-report.yaml b/.github/workflows/pulsar-ci-test-report.yaml deleted file mode 100644 index 47feb949166ad..0000000000000 --- a/.github/workflows/pulsar-ci-test-report.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -name: 'Pulsar CI Test Report' -on: - workflow_run: - workflows: ['Pulsar CI'] # runs after Pulsar CI workflow - types: - - completed -jobs: - report: - runs-on: ubuntu-20.04 - steps: - - uses: apache/pulsar-test-infra/test-reporter@master - with: - artifact: /(.*)-test-report/ - name: '$1 Tests' - path: '*.xml' - reporter: java-junit - max-annotations: 50 - token: ${{ secrets.GITHUB_TOKEN }} - fail-on-error: false - only-summary: true diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml index f008b2383abf5..65698a014c3e4 100644 --- a/.github/workflows/pulsar-ci.yaml +++ b/.github/workflows/pulsar-ci.yaml @@ -224,19 +224,12 @@ jobs: if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} uses: ./.github/actions/copy-test-reports - - name: Report test summary as warning + - name: Publish Test Report + uses: apache/pulsar-test-infra/action-junit-report@master if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} - uses: ./.github/actions/merge-test-reports with: - summary_title: 'Test Summary for Unit - ${{ matrix.name }}:' - - - name: Publish the Test reports in Junit xml format - uses: actions/upload-artifact@v3 - if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} - with: - name: Unit-${{ matrix.group }}-test-report - path: test-reports - retention-days: 7 + report_paths: 'test-reports/TEST-*.xml' + annotate_only: 'true' - name: Upload Surefire reports uses: actions/upload-artifact@v3 @@ -449,19 +442,12 @@ jobs: if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} uses: ./.github/actions/copy-test-reports - - name: Report test summary as warning + - name: Publish Test Report + uses: apache/pulsar-test-infra/action-junit-report@master if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} - uses: ./.github/actions/merge-test-reports with: - summary_title: 'Test Summary for Integration - ${{ matrix.name }}:' - - - name: Publish the Test reports in Junit xml format - uses: actions/upload-artifact@v3 - if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} - with: - name: Integration-${{ matrix.group }}-test-report - path: test-reports - retention-days: 7 + report_paths: 'test-reports/TEST-*.xml' + annotate_only: 'true' - name: Upload Surefire reports uses: actions/upload-artifact@v3 @@ -692,26 +678,19 @@ jobs: run: $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh print_thread_dumps - name: Aggregates all test reports to ./test-reports and ./surefire-reports directories - if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }} + if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} uses: ./.github/actions/copy-test-reports - - name: Report test summary as warning - if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }} - uses: ./.github/actions/merge-test-reports - with: - summary_title: 'Test Summary for System - ${{ matrix.name }}:' - - - name: Publish the Test reports in Junit xml format - uses: actions/upload-artifact@v3 - if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' }} + - name: Publish Test Report + uses: apache/pulsar-test-infra/action-junit-report@master + if: ${{ always() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} with: - name: System-${{ matrix.group }}-test-report - path: test-reports - retention-days: 7 + report_paths: 'test-reports/TEST-*.xml' + annotate_only: 'true' - name: Upload container logs uses: actions/upload-artifact@v3 - if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' }} + if: ${{ !success() && needs.changed_files_job.outputs.docs_only != 'true' && needs.changed_files_job.outputs.cpp_only != 'true' }} continue-on-error: true with: name: System-${{ matrix.group }}-container-logs