-
Notifications
You must be signed in to change notification settings - Fork 0
fix(coverage): disclose Rust coverage timeouts as not measured #2529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seonghobae
merged 3 commits into
main
from
seonghobae/rust-coverage-timeout-not-measured
Sep 30, 2026
+95
−10
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
4d1e11e
fix(coverage): disclose Rust coverage timeouts as not measured
seonghobae 28b3c78
docs(changelog): attribute the fast-mlsirm coverage failure to pytest…
seonghobae 491495a
Merge remote-tracking branch 'origin/main' into seonghobae/rust-cover…
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ### Rust coverage that only exceeds the per-command cap is disclosed as not measured | ||
|
|
||
| - fast-mlsirm's `mlsirm-core` suite runs for tens of minutes under `cargo llvm-cov` (56 min for | ||
| the workspace on a 4-job M-series host), past the sandbox's 900 s per-command cap, so every | ||
| Rust-changing PR failed coverage evidence on the timeout alone. For the Rust coverage commands | ||
| only, exit 124 (`timeout`) is now reported as `NOT MEASURED` and listed in the Coverage Decision, | ||
| instead of counting as a failure. Test failures, below-threshold coverage, kills (137) and every | ||
| other command still fail. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| """A Rust coverage run that only exceeds the per-command cap is recorded as not measured.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import subprocess | ||
| from pathlib import Path | ||
|
|
||
| WORKFLOW = Path(__file__).resolve().parents[1] / ".github/workflows/opencode-review-dispatch.yml" | ||
|
|
||
|
|
||
| def _classifier() -> str: | ||
| text = WORKFLOW.read_text(encoding="utf-8") | ||
| start = text.index(" record_command_result() {") | ||
| end = text.index("\n }\n", start) + len("\n }\n") | ||
| return "\n".join(line[10:] for line in text[start:end].splitlines()) | ||
|
|
||
|
|
||
| def _classify(rc: int, tolerate_timeout: bool) -> tuple[str, int, int]: | ||
| script = ( | ||
| "set -euo pipefail\nfailures=0\nnot_measured=0\nout=\"\"\n" | ||
| 'append() { out="$out$1\n"; }\n' | ||
| + _classifier() | ||
| + f"\ncoverage_timeout_not_measured={int(tolerate_timeout)}\n" | ||
| + f"record_command_result {rc}\n" | ||
| + 'printf "%s|%s|%s" "$out" "$failures" "$not_measured"\n' | ||
| ) | ||
| result = subprocess.run(["bash", "-c", script], capture_output=True, text=True, check=True) | ||
| text, failures, not_measured = result.stdout.rsplit("|", 2) | ||
| return text, int(failures), int(not_measured) | ||
|
|
||
|
|
||
| def test_success_passes() -> None: | ||
| assert _classify(0, True) == ("- Result: PASS\n", 0, 0) | ||
|
|
||
|
|
||
| def test_timeout_under_rust_coverage_is_not_measured() -> None: | ||
| text, failures, not_measured = _classify(124, True) | ||
| assert text.startswith("- Result: NOT MEASURED") | ||
| assert (failures, not_measured) == (0, 1) | ||
|
|
||
|
|
||
| def test_timeout_elsewhere_still_fails() -> None: | ||
| assert _classify(124, False) == ("- Result: FAIL (exit 124)\n", 1, 0) | ||
|
|
||
|
|
||
| def test_kill_or_test_failure_still_fails_under_rust_coverage() -> None: | ||
| assert _classify(137, True)[1:] == (1, 0) | ||
| assert _classify(1, True)[1:] == (1, 0) | ||
|
|
||
|
|
||
| def test_only_rust_coverage_calls_tolerate_the_timeout() -> None: | ||
| text = WORKFLOW.read_text(encoding="utf-8") | ||
| assert text.count("coverage_timeout_not_measured=1") == 1 | ||
| assert text.count("coverage_timeout_not_measured=0") == 2 # init + reset after Rust | ||
| rust = text.split("coverage_timeout_not_measured=1", 1)[1].split("coverage_timeout_not_measured=0", 1)[0] | ||
| assert "cargo llvm-cov --workspace" in rust | ||
| assert "cargo llvm-cov --manifest-path" in rust |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: ContextualWisdomLab/.github
Length of output: 6922
🏁 Script executed:
Repository: ContextualWisdomLab/.github
Length of output: 25867
시간 초과 허용 범위를
cargo llvm-cov호출로 제한하세요.현재 플래그가 설정된 상태에서
ensure_tauri_frontend_dist가 실행됩니다. 따라서 의존성 설치 또는 프런트엔드 빌드가 종료 코드 124를 반환해도record_command_result가 실패로 집계하지 않습니다.시간 초과 후
frontendDist가 생성되면 후속 디렉터리 검사가 성공하고 Rust coverage가 계속 실행됩니다.frontendDist가 없으면 별도의 실패 집계가 발생하지만, 시간 초과 자체는 여전히 실패로 기록되지 않습니다.플래그를 두
cargo llvm-cov호출 직전에 설정하고 호출 후 해제하세요.수정 예시
🤖 Prompt for AI Agents