Skip to content

Benchmark Test With Pytest #360

Benchmark Test With Pytest

Benchmark Test With Pytest #360

Workflow file for this run

---
name: Benchmark Test With Pytest
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
contents: write
deployments: write
packages: write
jobs:
benchmark:
name: Run pytest-benchmark benchmark
runs-on: [self-hosted]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Download test data
run: |
gh release download \
--pattern 'OTCamera19_FR20_2023-05-24_06-00-00_11-45-00.zip' \
--pattern 'OTCamera19_FR20_2023-05-24_00-00-00.zip' \
-R platomo/OpenTrafficCam-testdata -D tests/data
env:
GH_TOKEN: ${{ secrets.PLATOMO_OTC_TESTDATA_ACCESS }}
- name: Unzip test data
run: |
cd tests/data
unzip \*.zip
rm *.zip
cd ..
- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run benchmark tests
run: pytest ./tests/benchmark_otanalytics.py --benchmark-json output.json
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Python Benchmark with pytest-benchmark
tool: 'pytest'
output-file-path: output.json
auto-push: true
alert-threshold: '200%'
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
fail-on-alert: true