Repository navigation
fix(tier3): validate coverage against admitted attempt ordinals #663
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
chrisknvidia
merged 2 commits into
main
from
fix/christopherk/budget-admitted-attempt-ordinals
Nov 16, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| import pytest | ||
| from tests.tier3.test_baseline_timeouts import _attempt_job | ||
|
|
||
| from skillevaluator.tier3.harbor.collector import collect_harbor_results | ||
| from skillevaluator.tier3.harbor.runner import _merge_attempt_jobs | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("ordinals", [(1, 3), (1,), (3,), (), (1, 2), (1, 2, 3)]) | ||
| @pytest.mark.parametrize("reason", ["budget_exhausted", None, "execution_failed"]) | ||
| @pytest.mark.parametrize("stop_on_pass", [False, True]) | ||
| def test_coverage_uses_admitted_slots(tmp_path, ordinals, reason, stop_on_pass): | ||
| not_run = [] | ||
| for arm in ("with", "without"): | ||
| jobs = [ | ||
| _attempt_job(tmp_path, "agent", arm, "selector", ordinal, "pass" if ordinal == 3 else "fail") | ||
| for ordinal in ordinals | ||
| ] | ||
| _merge_attempt_jobs(jobs, tmp_path / "jobs" / f"demo-agent-{arm}") | ||
| row = {"agent": "agent", "arm": arm, "case_id": "selector", "attempt": 2, "status": "not_run"} | ||
| if reason is not None: | ||
| row["reason"] = reason | ||
| not_run.append(row) | ||
|
|
||
| result = collect_harbor_results( | ||
| skill_name="demo", | ||
| agents=["agent"], | ||
| output_dir=tmp_path / "results", | ||
| jobs_dir=tmp_path / "jobs", | ||
| n_attempts=3, | ||
| expected_trials=None if stop_on_pass else 3, | ||
| expected_case_ids=["case"], | ||
| expected_cases=1, | ||
| case_id_by_task_selector={"selector": "case"}, | ||
| budget_not_run=not_run, | ||
| stop_on_pass=stop_on_pass, | ||
| ) | ||
| omitted = reason != "execution_failed" | ||
| complete = ordinals == ((1, 3) if omitted else (1, 2, 3)) | ||
| assert result["execution_status"] == ("succeeded" if complete else "failed") | ||
| for condition in result["agents"]["agent"]["conditions"].values(): | ||
| assert condition["expected_attempts"] == (2 if omitted else 3) | ||
| if complete: | ||
| assert condition["scored_attempts"] == condition["expected_attempts"] | ||
| assert not condition["execution_errors"] | ||
| else: | ||
| assert any("scored attempts" in error for error in condition["execution_errors"]) |
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.
Uh oh!
There was an error while loading. Please reload this page.