Skip to content

add_pr_links: add unit tests - #6209

Open
janniklasrose wants to merge 2 commits into
janniklasrose/nextchanges-auto-add-pr-numberfrom
janniklasrose/add-pr-links-tests
Open

add_pr_links: add unit tests#6209
janniklasrose wants to merge 2 commits into
janniklasrose/nextchanges-auto-add-pr-numberfrom
janniklasrose/add-pr-links-tests

Conversation

@janniklasrose

@janniklasrose janniklasrose commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Add tools/add_pr_links_test.py — stdlib unittest coverage for add_pr_links.py, with the module's doctests folded in via load_tests.
  • Add a test-tools Taskfile task (discovers tools/*_test.py) and wire it into checks, so the task checks step in check.yml runs it in CI.

Why

tools/add_pr_links.py was previously covered only by doctests that nothing in root-module CI ran. This locks the behavior in an explicit suite and makes it run on every PR, including the case where a prior PR/issue reference in an entry's body must not block appending the PR link at the end.

Tests

./task test-tools (and ./task checks) — 23 tests (20 unit + 3 doctest), all passing. Verified a failing test makes the task exit non-zero.

Stacked on top of #6177.

This PR was written by Claude Code.

Cover entry splitting, end-of-entry placement, the skip-if-already-referenced
behavior (including a body reference that must not block appending), blank
handling, and process_file. Run with `uv run tools/add_pr_links_test.py`.

Co-authored-by: Isaac
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

Based on git history, these people are best suited to review:

  • @pietern -- recent work in ./, tools/

Eligible reviewers: @andrewnester, @anton-107, @denik, @lennartkats-db, @renaudhartert-db, @shreyas-goenka, @simonfaltum

Suggestions based on git history. See OWNERS for ownership rules.

Add a `test-tools` task that discovers tools/*_test.py, and fold it into
`checks` so the check.yml `task checks` step runs it. The test file also
pulls add_pr_links' doctests into its suite via load_tests, so one run covers
both.

Co-authored-by: Isaac
@janniklasrose
janniklasrose requested review from denik and pietern August 10, 2026 09:55
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: e08b9a3

Run: 31376560460

Env 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
💚​ aws linux 4 4 291 1095 6:32
💚​ aws windows 4 4 293 1093 8:17
💚​ azure linux 4 4 290 1095 6:12
💚​ azure windows 4 4 292 1093 6:48
💚​ gcp linux 1 5 291 1095 6:28
💚​ gcp windows 1 5 293 1093 6:03
8 interesting tests: 4 RECOVERED, 4 SKIP
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo 💚​R 💚​R 💚​R 💚​R 🙈​S 🙈​S
💚​ TestFetchRepositoryInfoAPI_FromRepo/root 💚​R 💚​R 💚​R 💚​R
💚​ TestFetchRepositoryInfoAPI_FromRepo/subdir 💚​R 💚​R 💚​R 💚​R
Top 6 slowest tests (at least 2 minutes):
duration env testname
8:08 aws windows TestAccept
6:39 azure windows TestAccept
5:56 gcp windows TestAccept
2:56 aws linux TestAccept
2:54 azure linux TestAccept
2:53 gcp linux TestAccept

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants