Skip to content

Commit

Permalink
test: adjust benchmarks to use new data
Browse files Browse the repository at this point in the history
  • Loading branch information
kod-kristoff committed Dec 9, 2024
1 parent 86be35f commit 32d1b67
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
--adapter python_pytest \
--file results.json \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
"pytest --benchmark-json results.json tests/benchmarks"
"pytest --benchmark-json results.json benchmarks"
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks_fork_pr_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: make dev
- name: Run Benchmarks for Forked PR
run: |
uv run pytest --benchmark-json benchmark_results-${{ matrix.python-version }}.json tests/benchmarks
uv run pytest --benchmark-json benchmark_results-${{ matrix.python-version }}.json benchmarks
- name: Upload Benchmark Results
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ jobs:
--adapter python_pytest \
--file results.json \
--github-actions '${{ secrets.GITHUB_TOKEN }}' \
"pytest --benchmark-json results.json tests/benchmarks"
"pytest --benchmark-json results.json benchmarks"
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,5 @@ snapshot-update:
install-dev-orjson:
uv sync --dev --extra orjson

assets/supp-data-gen/skbl.ndjson: assets/supp-data/data/skbl.json
${INVENV} python examples/json_ndjson_converter.py $< $@

run-benchmarks: assets/supp-data-gen/skbl.ndjson
${INVENV} pytest --benchmark-only tests/benchmarks
run-benchmarks:
${INVENV} pytest --benchmark-only benchmarks
10 changes: 5 additions & 5 deletions benchmarks/test_load_json_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ def consume_iter(it) -> None:
# assert sum(1 for _v in it) == expected_length


ARRAY_SMALL_JSON: str = "assets/supp-data/array_small.json"
ARRAY_MEDIUM_JSON: str = "assets/supp-data/array_medium.json"
ARRAY_SMALL_JSON: str = "assets/supp-data/data/array_small.json"
ARRAY_MEDIUM_JSON: str = "assets/supp-data/data/array_medium.json"
ARRAY_LARGE_JSON: str = "assets/supp-data/data/skbl.json"
ARRAY_SMALL_NDJSON: str = "assets/supp-data/array_small.ndjson"
ARRAY_MEDIUM_NDJSON: str = "assets/supp-data/array_medium.ndjson"
ARRAY_LARGE_NDJSON: str = "assets/supp-data-gen/skbl.ndjson"
ARRAY_SMALL_NDJSON: str = "assets/supp-data/data/array_small.ndjson"
ARRAY_MEDIUM_NDJSON: str = "assets/supp-data/data/array_medium.ndjson"
ARRAY_LARGE_NDJSON: str = "assets/supp-data/data/skbl.ndjson"


@pytest.mark.benchmark(group="load-from-file-small")
Expand Down

0 comments on commit 32d1b67

Please sign in to comment.