Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: start tracking time to run critical library tests #7221

Merged
merged 9 commits into from
Jan 29, 2025
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -595,10 +595,23 @@ jobs:
sed -i '/^compiler_version/d' ./**/Nargo.toml

- name: Run nargo test
id: test_report
working-directory: ./test-repo/${{ matrix.project.path }}
run: |

output_file=${{ github.workspace }}/noir-repo/.github/critical_libraries_status/${{ matrix.project.repo }}/${{ matrix.project.path }}.actual.jsonl
BEFORE=$SECONDS
nargo test --silence-warnings --skip-brillig-constraints-check --format json ${{ matrix.project.nargo_args }} | tee $output_file
TIME=$(($SECONDS-$BEFORE))

NAME=${{ matrix.project.repo }}/${{ matrix.project.path }}
# Replace any slashes with underscores
NAME=${NAME//\//_}
TEST_REPORT_NAME=test_report_$NAME
echo "test_report_name=$TEST_REPORT_NAME" >> $GITHUB_OUTPUT

jq --null-input "{ test_reports: [{ name: \"$NAME\", value: (\"$TIME\" | tonumber), unit: \"s\" }]}" > $TEST_REPORT_NAME.json

if [ ! -s $output_file ]; then
# The file is empty so we delete it to signal that `nargo test` failed before it could run any tests
rm -f $output_file
Expand All @@ -610,6 +623,60 @@ jobs:
working-directory: ./noir-repo
run: .github/scripts/check_test_results.sh .github/critical_libraries_status/${{ matrix.project.repo }}/${{ matrix.project.path }}.failures.jsonl .github/critical_libraries_status/${{ matrix.project.repo }}/${{ matrix.project.path }}.actual.jsonl

- name: Upload test report
uses: actions/upload-artifact@v4
with:
name: ${{ steps.test_report.outputs.test_report_name }}
path: ./test-repo/${{ matrix.project.path }}/${{ steps.test_report.outputs.test_report_name }}.json
retention-days: 3
overwrite: true

upload_critical_library_report:
name: Upload critical library report
needs: [external-repo-checks]
# We want this job to run even if one variation of the matrix in `external_repo_compilation_and_execution_report` fails
if: always()
runs-on: ubuntu-22.04
permissions:
pull-requests: write
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

steps:
- uses: actions/checkout@v4

- name: Download matrix test reports
uses: actions/download-artifact@v4
with:
pattern: test_report_*
path: ./reports

- name: Merge test reports using jq
run: |
jq --null-input "{ test_reports: [] }" > test_report.json
mv ./.github/scripts/merge-bench-reports.sh merge-bench-reports.sh
./merge-bench-reports.sh test_report
jq ".test_reports" < ./test_report.json > test_bench.json

- name: Store benchmark result
continue-on-error: true
uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29
with:
name: "Test Suite Duration"
tool: "customSmallerIsBetter"
output-file-path: ./test_bench.json
github-token: ${{ secrets.GITHUB_TOKEN }}
# We want this to only run on master to avoid garbage data from PRs being added.
auto-push: ${{ github.ref == 'refs/heads/master' }}
alert-threshold: "120%"
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: "@TomAFrench"
max-items-in-chart: 50


# This is a job which depends on all test jobs and reports the overall status.
# This allows us to add/remove test jobs without having to update the required workflows.
tests-end:
Expand Down
Loading