Skip to content

test: cover unit selector path in shard fixture - #43286

Closed
lorenzozanee wants to merge 1 commit into
BerriAI:mainfrom
lorenzozanee:fix/unit-shard-path-fixture
Closed

lorenzozanee wants to merge 1 commit into
BerriAI:mainfrom
lorenzozanee:fix/unit-shard-path-fixture

Conversation

@lorenzozanee

Copy link
Copy Markdown

TLDR

Problem this solves:

  • The temporary shard fixture never covers a nonempty UNIT_FLAG
  • Without the relative selector script, Bash exits 127 before pytest

How it solves it:

  • Stub the selector only for a flagged fixture and record its argument
  • Assert the emitted test path runs; preserve the empty-flag cases

Relevant issues

Fixes #43201

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The focused test file passes locally: 4 passed; Ruff check and format passed
  • My PR passes all required CI/CD checks (not observed)
  • My PR scope is isolated to fixture coverage for one problem
  • I have received a Greptile Confidence Score of at least 4/5 (not observed)

Screenshots / Proof of Fix

This adds fixture coverage. #43191 already clears UNIT_FLAG for the existing path-filter cases; this PR exercises the separate flagged branch.

Before (4eb340a)

Nonempty unit flag

  1. The extracted step runs from tmp_path; the relative selector script is absent and Bash exits 127 before pytest

After (this PR)

Nonempty unit flag

  1. The focused fixture suite passes with 4 tests

Type

✅ Test

Caveats (if any)

Low

  • The selector is stubbed; real misc path mapping is not exercised
  • Hosted CI and CLA signer status are unverified

Final Attestation

  • The tests cover all relevant real-world regressions without risk}

@lorenzozanee
lorenzozanee requested a review from a team September 26, 2026 05:43
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Low risk] Test file formatting and test coverage expansion.

The PR appears safe to merge, with a non-blocking gap in coverage for combined shard inputs.

Findings

  1. P2 Combined paths remain untested ▶

Summary

Adds a temporary selector stub and a test that runs the workflow’s nonempty UNIT_FLAG branch.

  • The new test covers selector-only execution, but not the combination of TEST_PATH and UNIT_FLAG used by the misc shard.

Reviews (1) · Last reviewed commit: "test: cover unit selector path in shard ..."

def test_unit_selection_paths_are_run(tmp_path: Path) -> None:
_write_passing_test(tmp_path)

result: Final = _run_shard(tmp_path, "", "0", unit_flag="misc")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Combined paths remain untested The real misc shard supplies both TEST_PATH and UNIT_FLAG, but this test leaves TEST_PATH empty. If the workflow stops including that explicit path, the test will still pass because the selector stub supplies the passing file. Add a distinct explicit test path and assert that both paths run.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri

Copy link
Copy Markdown
Contributor

#44461 removed the unit selector script and the UNIT_FLAG path, so this test case no longer applies on main. Reopen if something is missing

@mateo-berri mateo-berri closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants