Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
8 changes: 7 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ jobs:
from-lock: 'true'

- name: Run benchmarks
run: pytest --db-backend psql --benchmark-only --benchmark-json benchmark.json tests/
run: |
pytest
--db-backend psql
--benchmark-only
--benchmark-json benchmark.json
--ignore tests/benchmark/test_json_contains.py
tests/

- name: Store benchmark result
uses: aiidateam/github-action-benchmark@v3
Expand Down
3 changes: 3 additions & 0 deletions tests/benchmark/test_json_contains.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def extract_component(data, p: float = -1):
@pytest.mark.parametrize('breadth', [1, 2, 4])
@pytest.mark.usefixtures('aiida_profile_clean')
def test_deep_json(benchmark, depth, breadth):
random.seed(depth * 1000 + breadth * 10 + 42)
lhs = gen_json(depth, breadth)
rhs = extract_component(lhs, p=1.0 / depth)
assert 0 == len(QueryBuilder().append(orm.Dict).all())
Expand Down Expand Up @@ -89,6 +90,7 @@ def test_deep_json(benchmark, depth, breadth):
@pytest.mark.parametrize('breadth', [1, 10, 100])
@pytest.mark.usefixtures('aiida_profile_clean')
def test_wide_json(benchmark, depth, breadth):
random.seed(depth * 1000 + breadth * 10 + 42)
lhs = gen_json(depth, breadth)
rhs = extract_component(lhs, p=1.0 / depth)
assert 0 == len(QueryBuilder().append(orm.Dict).all())
Expand All @@ -115,6 +117,7 @@ def test_wide_json(benchmark, depth, breadth):
@pytest.mark.parametrize('num_entries', LARGE_TABLE_SIZE_RANGE)
@pytest.mark.usefixtures('aiida_profile_clean')
def test_large_table(benchmark, num_entries):
random.seed(num_entries + 42)
data = gen_json(2, 10)
rhs = extract_component(data)
assert 0 == len(QueryBuilder().append(orm.Dict).all())
Expand Down
Loading