Repository navigation
test: guard pcap regeneration on missing python3 or fixtures - #25
walsykerem wants to merge 1 commit into
Conversation
|
PR Summary by QodoSkip pcap regeneration test when prerequisites are unavailable
AI Description
Merge Risk
|
Code Review by Qodo
1. Committed pcap fixture going missing no longer fails the test
|
| committed, err := os.ReadFile("testdata/fixtures/pcap/fixture.pcap") | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| t.Skipf("fixture.pcap absent: %v", err) |
There was a problem hiding this comment.
1. Committed pcap fixture going missing no longer fails the test 🐞 Bug ≡ Correctness
The os.ReadFile error branch in TestR2L08FixturePcapRegeneratesByteForByte was changed from
t.Fatal to t.Skipf, so a deleted or misnamed committed pcap fixture reports SKIP instead of
FAIL. The new os.Getenv("CI") != "" guard also skips the whole byte-for-byte regeneration check
whenever CI is set to any non-empty value (including false or 0), which is the default on most
CI runners. Because the PR notes the checkout does not track the pcap fixtures, these two skips
together mean the regeneration check silently never runs in CI, so a regression in make.py or the
committed output goes unnoticed.
Agent Prompt
## Issue description
In test/op_round2_lane08_simulation_test.go, `TestR2L08FixturePcapRegeneratesByteForByte` has two skips that disable its only regression check for the pcap generator. First, the `os.ReadFile` error branch for `testdata/fixtures/pcap/fixture.pcap` now calls `t.Skipf` instead of failing, so a deleted or renamed committed fixture reports SKIP. Second, a new `os.Getenv("CI") != ""` guard skips the whole byte-for-byte regeneration whenever CI is non-empty, including `CI=false` or `CI=0`. Since the checkout does not track the pcap fixtures, these skips mean the check never runs in CI, and a regression in make.py or the committed output passes unnoticed.
## Fix Focus Areas
- test/op_round2_lane08_simulation_test.go[274-282]
- test/op_round2_lane08_simulation_test.go[285-291]
## Recommended Fix
1. Remove the `CI` environment check at the top of the test. Keep the `exec.LookPath("python3")` skip and the make.py existence skip, since those already cover runners that cannot run the generator.
2. In the ReadFile error branch, restore `t.Fatal(err)`. Only the python3 and make.py guards should skip.
3. If the checkout genuinely lacks the fixture, gate the skip on an explicit condition (for example, skip only when make.py is also absent, or move the fixture into a tracked location) rather than skipping on any read error.
4. If CI must not run external interpreters, make that an explicit opt-out with a clearly named variable, document it, and have the CI pipeline either provision the fixtures or fail loudly.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Qodo Fixer🍒 Ready to be cherry-picked — ✅ Merged (0) · ☑ Fixed (1) 🔗 Fix PR: #29 This fix PR was closed automatically. Its branch is preserved so you can cherry pick the changes into the original PR. Prompt for coding agent Process — 1 fixed
|
|
Recreated from verified backup (/Users/keremurhan/lrecon-pr-backup-20261126) as part of PR cleanup; replacement PR follows. |



Fixes #5
TestR2L08FixturePcapRegeneratesByteForBytenow skips instead of failing when it cannot safely regenerate the fixture:CIis set: externalpython3regeneration is not part of the CI-safe suite.python3is not onPATH, matchingtest/op_fixture_determinism_test.go.testdata/fixtures/pcap/make.pyorfixture.pcapis absent.When
python3and both fixtures are available, the generator runs and the byte-for-byte comparison is unchanged. No production code or dependencies changed.Tests:
cp test/*_test.go lrecon/ && go test ./lrecon -run '^TestR2L08FixturePcapRegeneratesByteForByte$' -v -count=1CI=true: SKIP, PASSpython3removed from PATH: SKIP, PASSThe checkout does not track the pcap fixtures, so the real
make.pycould not be exercised; the synthetic fixture covers the unchanged regeneration path.