You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dev/porting_legacy_tests.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,3 +88,22 @@ Follow the hyperlinks for lost base coverage (`LBC`) to address coverage gaps. H
88
88
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.
89
89
90
90
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