Skip to content

Commit

Permalink
Merge pull request #2300 from demergent-labs/failed_benchmark_indication
Browse files Browse the repository at this point in the history
add error message to markdown if benchmarks failed
  • Loading branch information
lastmjs authored Dec 10, 2024
2 parents 55a4eb5 + cc90e4b commit ed3cf13
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/benchmark_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ jobs:
runs-on: ubuntu-latest
outputs:
test-infos: ${{ steps.get-test-infos.outputs.test-infos }}
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.base-branch }}

- id: get-version
run: |
VERSION="$(jq -r '.version' package.json)"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- id: get-test-infos
uses: ./.github/actions/get_test_infos
with:
Expand Down Expand Up @@ -80,10 +86,28 @@ jobs:
run: dfx start --clean --background --host 127.0.0.1:8000 --artificial-delay 0

- name: Run npm test (continue on error)
id: record-benchmarks
working-directory: ${{ matrix.test.path }}
continue-on-error: true
run: AZLE_IDENTITY_STORAGE_MODE=plaintext AZLE_RECORD_BENCHMARKS=true npm test

- name: Handle test failure
working-directory: ${{ matrix.test.path }}
if: steps.record-benchmarks.outcome == 'failure'
run: |
echo "The benchmark test failed"
if [ -f benchmarks.md ]; then
# Create a temporary file with the failure message
echo "⚠️ **WARNING: Benchmark process failed for version ${{ needs.prepare-benchmark.outputs.version }}**" > temp.md
echo "" >> temp.md
# Append the original content
cat benchmarks.md >> temp.md
# Replace the original file
mv temp.md benchmarks.md
else
echo "⚠️ **WARNING: Benchmark process failed for version ${{ needs.prepare-benchmark.outputs.version }}**" > benchmarks.md
fi
- name: Create branch name
id: create-branch-name
uses: ./.github/actions/create_branch_name
Expand Down

0 comments on commit ed3cf13

Please sign in to comment.