test: Make a fixture file the only kind of test - #1699
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1699 +/- ##
==========================================
- Coverage 98.01% 98.00% -0.01%
==========================================
Files 180 180
Lines 16332 16288 -44
Branches 3739 3736 -3
==========================================
- Hits 16007 15963 -44
Misses 247 247
Partials 78 78
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
0c1d1da to
70bbfdb
Compare
7edd03a to
56bab94
Compare
17365fe to
3d12e3f
Compare
3d12e3f to
be2f78a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The blockchain runner’s new direct-file collection branch lacks dedicated test coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Unifies fixture handling so each file is collected as one test without loading it during collection.
Changes:
- Defers fixture loading until execution.
- Aligns named-file and directory behavior.
- Updates file-level collection and counting expectations.
File summaries
| File | Review |
|---|---|
test/statetest/statetest.cpp |
Implements unified collection; update stale function and filtering comments. |
test/integration/evmone-cli/test/statetest/CMakeLists.txt |
Updates state-test collection expectations. |
test/integration/evmone-cli/test/blockchaintest/CMakeLists.txt |
Updates blockchain execution-count expectations. |
test/blockchaintest/blockchaintest.cpp |
Implements equivalent behavior, but needs direct-file --collect-only coverage asserting test.json appears once. |
Review details
Suppressed comments (3)
test/blockchaintest/blockchaintest.cpp:43
- This changes directly named files to one file-level test, but the
pathoption help at lines 59–61 still promises one separate test per fixture inside the file. Update the user-facing description so it matches the new collection semantics.
}});
test/statetest/statetest.cpp:52
- This changes directly named files to one file-level test, but the
pathoption help at lines 68–70 still tells users that each test inside a named file becomes a separate test. Update the CLI contract together with the behavior.
}});
test/statetest/statetest.cpp:50
- Filtering now happens inside the file test for directly named files as well as directory entries. The
filter_directoryintegration-test comment still says the direct-file case applies-kat registration, so it now documents a distinction that no longer exists; update that comment with this behavior change.
if (selected(test))
evmone::test::run_state_test(test, vm, trace, report);
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
be2f78a to
53b262a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Fix the integration coverage omission and update the outdated CLI help text.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Balanced
53b262a to
3760614
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Lazy-loading coverage and help-text accuracy must be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (4)
test/blockchaintest/blockchaintest.cpp:40
- The deleted unloadable-file case leaves this new lazy-loading guarantee untested: all remaining direct-file collection tests use valid JSON, so they still pass if collection accidentally starts parsing files again. Keep
not_json.txtas a--collect-onlycase that must succeed and list the path once, and separately assert that running it fails.
cases.push_back(
{file.path.string(), [path = file.path, &vm](evmone::test::TestReport& report) {
std::ifstream f{path};
test/blockchaintest/blockchaintest.cpp:60
- The help text's
index.jsonexception applies only while walking a directory. A directly namedindex.json(or even a non-JSON file) reaches theelsebranch above and is registered as one test, so this currently documents behavior that the command does not enforce. Distinguish named-file handling from directory discovery.
"Path to a test file or a directory of them. Every .json file is one test, "
"except index.json, which is not a test file.")
test/statetest/statetest.cpp:69
- The help text's
index.jsonexception applies only while walking a directory. A directly namedindex.json(or even a non-JSON file) reaches theelsebranch above and is registered as one test, so this currently documents behavior that the command does not enforce. Distinguish named-file handling from directory discovery.
"Path to a test file or a directory of them. Every .json file is one test, "
"except index.json, which is not a test file.")
test/statetest/statetest.cpp:49
- Named files now use this deferred
selectedpredicate too, but thefilter_directorytest comment intest/integration/evmone-cli/test/statetest/CMakeLists.txt:99-101still says filtering happens at registration for the direct-file test above. Update that comment so it no longer describes the removed distinction.
[path = file.path, selected, &vm, trace](evmone::test::TestReport& report) {
std::ifstream f{path};
for (const auto& test : evmone::test::load_state_tests(f))
{
if (selected(test))
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
425baca to
4ef815c
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The state-test help text does not accurately describe direct-file behavior.
Review details
Suppressed comments (1)
test/statetest/statetest.cpp:69
- This help text is inaccurate for directly named paths:
collect_tests()treats any non-directory—includingindex.jsonand thenotes.txtfixture exercised below—as one test. Restrict the.json/index.jsonrule to directory traversal and describe the direct-file behavior, as the blockchain runner does.
"Path to a test file or a directory of them. Every .json file is one test, "
"except index.json, which is not a test file.")
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Balanced
4ef815c to
ee1022a
Compare
ee1022a to
5e8b6eb
Compare
7f9060c to
e2b5133
Compare
e2b5133 to
05f7fca
Compare
46b448d to
d398555
Compare
05f7fca to
dd57611
Compare
029b414 to
4840b3d
Compare
dd57611 to
418522b
Compare
Naming a file collected one test per fixture in it, which naming a directory could not afford: enumerating fixtures means loading every file, and a release is gigabytes. The two forms counted, filtered and skipped differently, and only one of them scaled. A file is now one test either way, and collection loads nothing, so it can no longer fail. Three consequences a reader should not have to infer from the diff: --collect-only on a named file lists the file rather than what is inside it, a -k which selects nothing from a named file now passes, as it already did for a directory, and --ignore applies to a named file as well, relative to that file. Claude-Session: https://claude.ai/code/session_016UHPAGwcwXMjqhTLpT31K7
418522b to
eea90ca
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
Blockchain-runner direct-file ignore behavior lacks dedicated regression coverage.
Review details
Suppressed comments (1)
test/integration/evmone-cli/test/blockchaintest/CMakeLists.txt:104
- The new direct-file
--ignorepath is only exercised by the statetest integration suite, so this separate blockchain-runner implementation can regress (for example, by usingrootinstead ofroot.parent_path()) while all blockchain tests still pass. Add the analogous two-file collection case here, ignoring one basename and asserting only the other file is listed.
PASS_REGULAR_EXPRESSION "^[^\n]*test\\.json\n$"
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Naming a file used to collect one test per fixture in it, which naming a directory could not afford: enumerating fixtures means loading every file, and a release is gigabytes. The two forms counted, filtered and skipped differently, and only one of them scaled.
A file is now one test either way, in both tools. Nothing is read until a test runs, so what
--collect-onlylists no longer depends on how the path was given.Peeled out of #1685 to land the behaviour change on its own: a few tests change meaning here, which is worth reading apart from the command that replaces these tools.