← Về thư mục
scripts/test_check_ranking_lift.py
- test_compute_signed_lift_combos · function · L29-L34 — def test_compute_signed_lift_combos(baseline, compare, direction, expected)
- test_zero_baseline_negative_inf_lower_is_better · function · L37-L39 — def test_zero_baseline_negative_inf_lower_is_better(): # lower_is_better, baseline 0, compare worsens (goes up) -> -inf
- test_compute_signed_lift_rejects_unknown_direction · function · L42-L44 — def test_compute_signed_lift_rejects_unknown_direction()
- _report · function · L50-L64 — def _report(task="citation_extraction", agg_value=0.95, agg_metric="accuracy", agg_direction="higher_is_better", per_class=None)
- test_flatten_includes_measured_task · function · L70-L77 — def test_flatten_includes_measured_task()
- test_flatten_skips_pending_task · function · L80-L93 — def test_flatten_skips_pending_task()
- test_flatten_skips_skipped_task · function · L96-L101 — def test_flatten_skips_skipped_task()
- test_flatten_skips_unknown_nonmeasured_status · function · L104-L112 — def test_flatten_skips_unknown_nonmeasured_status()
- test_flatten_missing_status_treated_as_measured · function · L115-L123 — def test_flatten_missing_status_treated_as_measured()
- test_higher_is_better_positive_passes · function · L129-L134 — def test_higher_is_better_positive_passes(monkeypatch)
- test_regression_blocks_without_ack · function · L137-L144 — def test_regression_blocks_without_ack(monkeypatch)
- test_lower_is_better_polarity_inverted · function · L147-L157 — def test_lower_is_better_polarity_inverted(monkeypatch): # FNR improvement (drops 0.40 -> 0.20) is POSITIVE lift -> not a regression.
- test_boundary_minus_005_passes_strict · function · L160-L170 — def test_boundary_minus_005_passes_strict(monkeypatch): # signed_lift of -0.05 must PASS (strict < threshold, float-noise tolerant). # (0.95-1.0)/1.0 == -0.05000000000000004 in IEEE-754 — without the epsilon # tolerance this exact-boundary case would wrongly block.
- test_boundary_minus_00501_blocks · function · L173-L178 — def test_boundary_minus_00501_blocks(monkeypatch)
- test_zero_baseline_plus_inf_passes · function · L181-L191 — def test_zero_baseline_plus_inf_passes(monkeypatch): # Zero baseline, improved -> +inf. Still a zero-baseline CHANGE, so it # requires acknowledgement (any zero-baseline change must be acked).
- test_zero_baseline_minus_inf_blocks_unless_acked · function · L194-L199 — def test_zero_baseline_minus_inf_blocks_unless_acked(monkeypatch)
- test_acked_and_open_passes · function · L202-L210 — def test_acked_and_open_passes(monkeypatch)
- test_acked_but_closed_blocks · function · L213-L222 — def test_acked_but_closed_blocks(monkeypatch)
- test_affected_metric_mismatch_blocks · function · L225-L235 — def test_affected_metric_mismatch_blocks(monkeypatch): # Acked + open issue, but declared metric does not match the observed regression.
- test_no_regression_no_network · function · L238-L246 — def test_no_regression_no_network(monkeypatch): # If nothing regresses, the gate must NOT consult _issue_is_open at all.
- boom · function · L240-L241 — def boom(url): # pragma: no cover - must never run
- test_parse_pr_body_extracts_tokens · function · L249-L256 — def test_parse_pr_body_extracts_tokens()
- _report_two_metrics · function · L262-L277 — def _report_two_metrics(agg_value=0.95): # baseline carries an extra per_class metric that compare will drop.
- test_dropped_metric_is_a_violation · function · L280-L288 — def test_dropped_metric_is_a_violation(monkeypatch)
- test_dropped_metric_blocks_without_ack · function · L291-L297 — def test_dropped_metric_blocks_without_ack(monkeypatch)
- test_cross_repo_issue_url_rejected_by_issue_is_open · function · L303-L310 — def test_cross_repo_issue_url_rejected_by_issue_is_open(monkeypatch): # _issue_is_open must short-circuit to False for a foreign repo BEFORE any # network call. Make the network path explode to prove it is never reached.
- boom · function · L306-L307 — def boom(a, *k): # pragma: no cover - must never run
- test_cross_repo_open_issue_does_not_satisfy_ack · function · L313-L327 — def test_cross_repo_open_issue_does_not_satisfy_ack(monkeypatch): # Even if a foreign repo's issue is "open", it must not unblock the gate. # Real _issue_is_open rejects cross-repo URLs without networking, so we use # the real function but stub subprocess to fail loudly if it is ever called.
- test_one_open_one_closed_same_repo_passes · function · L333-L344 — def test_one_open_one_closed_same_repo_passes(monkeypatch): # First URL closed, second URL open -> >=1 open -> gate passes.
- test_issue_url_regex_is_bounded · function · L347-L364 — def test_issue_url_regex_is_bounded(monkeypatch): # Precision: a glued prefix must not match, the github.com dot is literal, # and a trailing path segment must not smuggle extra digits (codex R2 P2).
- test_all_closed_same_repo_blocks · function · L367-L377 — def test_all_closed_same_repo_blocks(monkeypatch)