Skip to content

Benchmark Test With Pytest #323

Benchmark Test With Pytest

Benchmark Test With Pytest #323

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 '*.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