From 9ff49c679575b25079ad6bead72cb73d0e2bf8f5 Mon Sep 17 00:00:00 2001 From: Ketan Pramod Kolte <75748186+ketanpkolte@users.noreply.github.com> Date: Fri, 18 Oct 2024 22:42:36 +0530 Subject: [PATCH] Fixed GitHub workflow report for failed tests (#2653) * changed target framework to .net 8.0 * Added a failing test * Update run-tests.yaml * try again * changed yaml files * Revert "try again" This reverts commit 1995f60de5d266087e6c88ad31f3b655ec7277ae. * Revert "Added a failing test" This reverts commit 1bcb1a19029d574191436c4627c8449b8b18f525. * Final yaml files * added target framework back for PR --- .github/workflows/report-test-results.yaml | 14 +++++++++++++- .github/workflows/run-tests.yaml | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/report-test-results.yaml b/.github/workflows/report-test-results.yaml index 005465b329..2e54b831ee 100644 --- a/.github/workflows/report-test-results.yaml +++ b/.github/workflows/report-test-results.yaml @@ -12,12 +12,24 @@ jobs: runs-on: ubuntu-latest permissions: write-all steps: + # Cleanup Old Files + - name: Cleanup Old Files + run: rm -rf $GITHUB_WORKSPACE/*.trx + + # Download the Latest Artifacts with Unique Name - name: Download Artifacts uses: dawidd6/action-download-artifact@v2 with: - workflow: ${{ github.event.workflow_run.workflow_id }} + run_id: ${{ github.event.workflow_run.id }} + + # Display the Structure of Downloaded Files - name: Display structure of downloaded files run: ls -R + + # Display the Contents of .trx Files + - name: Display .trx file contents + run: cat **/*.trx || echo "No .trx files found" + - name: Report tests results uses: AndreyAkinshin/test-reporter@0e2c48ebec2007001dd77dd4bcbcd450b96d5a38 with: diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 698b429514..f42f2596a5 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -18,17 +18,19 @@ jobs: run: Set-MpPreference -DisableRealtimeMonitoring $true shell: powershell - uses: actions/checkout@v4 + # Build and Test - name: Run task 'build' shell: cmd run: ./build.cmd build - name: Run task 'in-tests-core' shell: cmd run: ./build.cmd in-tests-core -e + # Upload Artifacts with Unique Name - name: Upload test results uses: actions/upload-artifact@v3 if: always() with: - name: test-windows-core-trx + name: test-windows-core-trx-${{ github.run_id }} path: "**/*.trx" test-windows-full: @@ -38,23 +40,26 @@ jobs: run: Set-MpPreference -DisableRealtimeMonitoring $true shell: powershell - uses: actions/checkout@v4 + # Build and Test - name: Run task 'build' shell: cmd run: ./build.cmd build - name: Run task 'in-tests-full' shell: cmd run: ./build.cmd in-tests-full -e + # Upload Artifacts with Unique Name - name: Upload test results uses: actions/upload-artifact@v4 if: always() with: - name: test-windows-full-trx + name: test-windows-full-trx-${{ github.run_id }} path: "**/*.trx" test-linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + # Set up the environment - name: Set up Clang uses: egor-tensin/setup-clang@v1 with: @@ -70,17 +75,19 @@ jobs: run: npm install jsvu -g && jsvu --os=linux64 --engines=v8 && echo "$HOME/.jsvu/bin" >> $GITHUB_PATH - name: Install wasm-tools workload run: ./build.cmd install-wasm-tools + # Build and Test - name: Run task 'build' run: ./build.cmd build - name: Run task 'unit-tests' run: ./build.cmd unit-tests -e - name: Run task 'in-tests-core' run: ./build.cmd in-tests-core -e + # Upload Artifacts with Unique Name - name: Upload test results uses: actions/upload-artifact@v4 if: always() with: - name: test-linux-trx + name: test-linux-trx-${{ github.run_id }} path: "**/*.trx" test-macos: @@ -95,17 +102,19 @@ jobs: run: npm install jsvu -g && jsvu --os=mac64 --engines=v8 && echo "$HOME/.jsvu/bin" >> $GITHUB_PATH - name: Install wasm-tools workload run: ./build.cmd install-wasm-tools + # Build and Test - name: Run task 'build' run: ./build.cmd build - name: Run task 'unit-tests' run: ./build.cmd unit-tests -e - name: Run task 'in-tests-core' run: ./build.cmd in-tests-core -e + # Upload Artifacts with Unique Name - name: Upload test results uses: actions/upload-artifact@v4 if: always() with: - name: test-macos-trx + name: test-macos-trx-${{ github.run_id }} path: "**/*.trx" test-pack: