-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
436 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# .github/workflows/regression_tests.yml | ||
name: Regression Tests | ||
|
||
on: | ||
# pull_request: | ||
# branches: | ||
# - main | ||
|
||
jobs: | ||
regression_tests: | ||
name: regression_tests | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
lfs: true | ||
fetch-depth: 0 # This ensures we can checkout main branch too | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
architecture: 'x64' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e ".[dev]" | ||
- name: Run benchmarks and compare to baseline | ||
if: github.event.pull_request.base.ref == 'main' | ||
run: | | ||
# # Check if regression test results exist in main branch | ||
# if [ -f 'git cat-file -e main:tests/regression_test_baselines.json' ]; then | ||
# git checkout main tests/regression_test_baselines.json | ||
# else | ||
# echo "No regression test results found in main branch" | ||
# fi | ||
pytest -m regression | ||
# git checkout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# .github/workflows/update_regression_tests.yml | ||
name: Update Regression Baseline | ||
|
||
on: | ||
# issue_comment: # event runs on the default branch | ||
# types: [created] | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
update_regression_tests: | ||
name: update_regression_tests | ||
runs-on: ubuntu-20.04 | ||
# if: github.event.issue.pull_request && contains(github.event.comment.body, '/update_baseline') | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
env: | ||
username: ${{ github.event.pull_request.user.login }} # ${{ github.actor }} | ||
|
||
steps: | ||
# - name: Get PR branch | ||
# uses: xt0rted/pull-request-comment-branch@v1 | ||
# id: comment-branch | ||
|
||
- name: Checkout PR branch | ||
uses: actions/checkout@v3 | ||
with: | ||
# ref: ${{ steps.comment-branch.outputs.head_sha }} # using head_sha vs. head_ref makes this work for forks | ||
lfs: true | ||
fetch-depth: 0 # This ensures we can checkout main branch too | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
architecture: 'x64' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e ".[dev]" | ||
- name: Update baseline | ||
if: github.event.pull_request.base.ref == 'main' | ||
run: | | ||
git config --global user.name '$username' | ||
git config --global user.email '[email protected]' | ||
mv tests/regression_test_baselines.json tests/regression_test_baselines.json.bak | ||
NEW_BASELINE=1 pytest -m regression | ||
- name: Add Baseline update report to PR comment | ||
uses: actions/github-script@v7 | ||
if: always() | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const fs = require('fs'); | ||
const TestReport = fs.readFileSync('tests/regression_test_report.txt', 'utf8'); | ||
await github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: `## New Baselines \n\`\`\`\n${TestReport}\n\`\`\`` | ||
}); | ||
- name: Commit and push | ||
if: github.event.pull_request.base.ref == 'main' | ||
run: | | ||
git add -f tests/regression_test_baselines.json # since it's in .gitignore | ||
git commit -m "Update regression test baselines" | ||
# git push origin HEAD:${{ steps.comment-branch.outputs.head_sha }} | ||
git push origin HEAD:${{ github.head_ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"ec3a4fad11d2bfb1bc5f8f10529cb06f2ff9919b377e9c0a3419c7f7f237f06e": { | ||
"test_name": "test_runtime", | ||
"input_kwargs": { | ||
"num_cells": 1, | ||
"artificial": false, | ||
"connect": false, | ||
"connection_prob": 0.0, | ||
"voltage_solver": "jaxley.stone" | ||
}, | ||
"runtimes": { | ||
"build_time": 0.10014088948567708, | ||
"compile_time": 0.3103648026784261, | ||
"run_time": 0.2102543512980143 | ||
} | ||
} | ||
} |
Oops, something went wrong.