File tree Expand file tree Collapse file tree 6 files changed +526
-2
lines changed Expand file tree Collapse file tree 6 files changed +526
-2
lines changed Original file line number Diff line number Diff line change 9393 with :
9494 python-version : " 3.11"
9595 - uses : ./.github/actions/setup-env
96+ - name : Cache fixture database
97+ id : cache-fixtures-db
98+ uses : actions/cache@v4
99+ with :
100+ path : tests/json_infra/fixtures.db
101+ key : fixtures-db-${{ hashFiles('tests/json_infra/fixtures/**/*.json') }}
102+ - name : Build fixture database if cache miss
103+ if : steps.cache-fixtures-db.outputs.cache-hit != 'true'
104+ run : uv run python tests/json_infra/build_fixture_db.py
96105 - name : Run json infra tests
97106 run : tox -e json_infra
107+ env :
108+ EELS_USE_FIXTURE_DB : 1
98109 - name : Upload coverage reports to Codecov
99110 uses : codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
100111 with :
Original file line number Diff line number Diff line change 8282env.yaml
8383
8484site /
85+
86+ # fixture db
87+ tests /json_infra /fixtures.db
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ """
3+ Build SQLite database from JSON test fixtures.
4+
5+ Usage:
6+ python -m tests.json_infra.build_fixture_db
7+ """
8+
9+ import sys
10+ from pathlib import Path
11+
12+ from tests .json_infra .helpers .fixture_db import FixtureDatabase
13+
14+ # Add project root to path
15+ project_root = Path (__file__ ).parent .parent .parent
16+ sys .path .insert (0 , str (project_root ))
17+
18+
19+ def main ():
20+ """Build fixture DB."""
21+ db_path = "tests/json_infra/fixtures.db"
22+ db = FixtureDatabase (db_path )
23+ db .initialize_schema ()
24+ db .load_all_state_tests ()
25+ db .load_all_blockchain_tests ()
26+ db .close ()
27+
28+
29+ if __name__ == "__main__" :
30+ main ()
You can’t perform that action at this time.
0 commit comments