Skip to content

test(repo): cover failure_excerpt and is_setup directly - #280

Merged
connabyss merged 1 commit into
mainfrom
weekly-helper/repo-helper-tests
Nov 29, 2026
Merged

connabyss merged 1 commit into
mainfrom
weekly-helper/repo-helper-tests

Conversation

@claude

@claude claude Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What was wrong, what you changed, how you checked:

failure_excerpt (the lines a report shows for a failing test) and is_setup (which files count as test setup) in repo.py had no direct tests. I added tests/test_repo_helpers.py with 4 small offline tests. No Bite code changed. python -m pytest -n auto: 478 passed, 4 skipped.

Fixes n/a

  • The title says what changed, in the Conventional Commit style.
  • It links the issue it fixes: n/a
  • For a bug fix: n/a (tests only, no bug fix)
  • python -m pytest passes.

Assisted-by: Claude Code

Plain 3-line lesson

A helper with no test can break and nobody notices.
Small tests that pin down what a function does today make later changes safe.
Test the edges too: no match, too many lines, and upper vs lower case.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added coverage for failure excerpts, including fallback behavior and requested line limits.
    • Added coverage for recognizing setup files by test command and case-insensitive file patterns.

Assisted-by: Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@claude claude Bot added the weekly-helper Opened by the weekly helper label Nov 29, 2026
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds direct tests for repo.failure_excerpt and repo.is_setup. The tests check excerpt selection around failure markers, fallback to the final requested lines, and line-count limits. They also check setup matching by test command and case-insensitive globs, and exclude an unrelated source path.

Merge Risk: Minimal · up to 66330

This change only adds test coverage for repository helper behavior and does not alter production code. No merge-blocking risk remains.

Security architecture risk: Minimal · up to 66330

The PR adds four tests for existing behavior. It does not change how the application runs, what it exposes, or how it is deployed.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: new direct tests for failure_excerpt and is_setup. It follows the Conventional Commit style with a test(repo) scope. It is specific and matches the changeset, which on…
Description check Passed The description covers what changed, why, and how it was checked. It names the new test file, the two functions under test, and the pytest result. It includes the template checklist and the Assisted-b…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: new direct tests for failure_excerpt and is_setup. It follows the Conventional Commit style with a test(repo) scope. It is specific and matches the changeset, which only adds tests/test_repo_helpers.py.

Full details: Description check

Explanation

The description covers what changed, why, and how it was checked. It names the new test file, the two functions under test, and the pytest result. It includes the template checklist and the Assisted-by line. Gaps: the 'Fixes' line is filled as n/a, and the checklist omits the template's 'bite live' note. Both are optional for a tests-only change. The description also lists the template's 'python -m pytest' check, but the author ran '-n auto', which is a minor variation and still runs the suite. The template asks for test-suite reporting in tests/selftest.py, which is not mentioned. These gaps are minor, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 944cc5d and 663301a.

Files selected for processing: 1

  • tests/test_repo_helpers.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Bite ➖ Bite: nothing here to check

No commit in this pull request changed code: only docs, settings or tests.

How Bite checks

Bite asks one question about each change: if it disappeared, would any test notice? It takes the change out, runs your tests, and puts it back. What is Bite?

@connabyss
connabyss enabled auto-merge (squash) November 29, 2026 06:02
@connabyss
connabyss merged commit b7beada into main Nov 29, 2026
21 checks passed
@connabyss
connabyss deleted the weekly-helper/repo-helper-tests branch November 29, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

weekly-helper Opened by the weekly helper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants