Skip to content

Commit 8936d0b

Browse files
committed
ci: normalize mtimes for eth2shuffle and genesiswrite fixtures
cl/utils/eth2shuffle reads spec/tests.csv at runtime and execution/state/genesiswrite reads genesis_test.json at runtime. Neither path was covered by git restore-mtime, so their mtimes varied between CI runs and prevented Go test result caching for those packages. Document the requirement: any test that reads a data file at runtime outside a testdata/ directory must add it to the restore-mtime list.
1 parent a3ec862 commit 8936d0b

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/actions/setup-erigon/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,16 @@ runs:
172172
# execution/tests/test-corners/** - custom edge-case fixtures
173173
# cl/spectest/**/data_*/** - consensus spec test data
174174
# cl/transition/**/test_data/** - consensus transition test data
175-
# Extensions: .json .js .txt .ssz .ssz_snappy .yaml
175+
# cl/utils/eth2shuffle/spec/** - shuffle spec CSV (read at runtime)
176+
# execution/state/genesiswrite/*.json - genesis JSON (read at runtime)
177+
# Extensions: .json .js .txt .ssz .ssz_snappy .yaml .csv
176178
time git restore-mtime --no-directories -- \
177179
'**/testdata/**' \
178180
'execution/tests/test-corners/**' \
179181
'cl/spectest/**/data_*/**' \
180-
'cl/transition/**/test_data/**'
182+
'cl/transition/**/test_data/**' \
183+
'cl/utils/eth2shuffle/spec/**' \
184+
'execution/state/genesiswrite/*.json'
181185
182186
# Submodules are all fixture data; set mtimes to HEAD commit time.
183187
git submodule foreach --quiet --recursive \

agents.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,11 @@ Common lint categories and fixes:
7575
## Workflows
7676

7777
Make sure all scripts and shell code used from GitHub workflows is cross platform, for macOS, Windows and Linux.
78+
79+
## Go Test Caching
80+
81+
Go's test result cache keys on the mtime+size of every file read (via Go stdlib) during a test run. CI normalizes mtimes via `git restore-mtime` in `.github/actions/setup-erigon/action.yml` so that unchanged files get stable mtimes across runs.
82+
83+
**When a test reads a data file at runtime** (via `os.Open`, `os.ReadFile`, `os.Stat`, etc.) that lives outside a `testdata/` directory, it must be added to the `git restore-mtime` pattern list in `setup-erigon/action.yml`. Otherwise that package's test results will never be cached in CI.
84+
85+
Covered patterns already include `**/testdata/**`, `execution/tests/test-corners/**`, `cl/spectest/**/data_*/**`, `cl/transition/**/test_data/**`, `cl/utils/eth2shuffle/spec/**`, and `execution/state/genesiswrite/*.json`.

0 commit comments

Comments
 (0)