Skip to content

Commit 9aeacd5

Browse files
authored
feat(fill): add coverage_missed_reason keyword argument to ported_from marker (ethereum#1746)
1 parent a1e6cd5 commit 9aeacd5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

dev/porting_legacy_tests.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,22 @@ Follow the hyperlinks for lost base coverage (`LBC`) to address coverage gaps. H
8888
Also note that yul tests and possibly other tests used `CALLDATALOAD` that might no longer needed when designing a test with python. But we must always investigate if an opcode is not covered anymore to see if its okay.
8989

9090
For example, review the [discussion in this PR.](https://github.com/ethereum/execution-spec-tests/pull/975#issuecomment-2528792289)
91+
92+
## Resolving Coverage Gaps from Yul Compilation
93+
94+
When porting tests from ethereum/tests, you may encounter coverage gaps that are false positives. This commonly occurs because:
95+
96+
- **Original tests** often used Yul to define smart contracts, and solc compilation introduces additional opcodes that aren't specifically under test
97+
- **EEST ports** typically use the explicit EEST Opcode mini-language, which is more precise in opcode definition
98+
99+
If coverage analysis shows missing opcodes that were only present due to Yul compilation artifacts (not the actual feature being tested), this can be resolved during PR review by adding the `coverage_missed_reason` parameter:
100+
101+
```python
102+
@pytest.mark.ported_from(
103+
["path/to/original_test.json"],
104+
coverage_missed_reason="Missing opcodes are Yul compilation artifacts, not part of tested feature"
105+
)
106+
```
107+
108+
!!! note "Add coverage_missed_reason only after PR review"
109+
Only add `coverage_missed_reason` after PR review determines the coverage gap is acceptable, never preemptively. This helps maintain test coverage integrity while accounting for legitimate differences between Yul-based and EEST opcode-based implementations.

0 commit comments

Comments
 (0)