Skip to content

tests/test_tests_workflow.py runs the package job's wheel check on four more wheels and its step 10 whole, so neither loses a check with the suite green, and holds the two locks' tomli entries equal (part of opensoft/openRepoTools#275) - #13

Merged
brettheap merged 4 commits into
mainfrom
pick/275-code-lane2
Nov 9, 2026

Conversation

@brettheap

@brettheap brettheap commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openRepoTools-2
Claim: opensoft/openRepoTools#275 (comment)

Six checks of the package job in tests.yml could be removed with tests/test_tests_workflow.py still
passing: the stamp compare, the module compare, the member list, the duplicate-member check, the
count line and the 28 receipt rows. The first pick runs the wheel check on four more wheels (a
module with a byte changed, the stamp with a line added, a member nothing lists, a member written
twice) and step 10 whole, offline, on a stand-in for pipx's link, and each check removed alone now
fails a case. The second pick names, in the pipx lock's header, the tomli entry it shares with the
build lock, adds a test that holds the two entries equal, and corrects two comments in tests.yml and
one docstring. In tests.yml and in the pipx lock only comments change.

The picks, from lane openRepoTools-2's branches in opensoft/openRepoTools, each made with git cherry-pick -x and followed by its source commit:

  • The package job's stamp compare, module compare, member list, duplicate-member check, count line and 28 receipt rows can no longer be removed with the suite green: tests/test_tests_workflow.py runs the wheel check on four more wheels and step 10 whole on a stand-in for pipx's link
    (cherry picked from commit 5b87b2653f00c978d07db40e8709c010e24bd908)
  • The pipx lock's header names the tomli entry it shares with the build lock and tests/test_tests_workflow.py holds the two entries equal, and two comments in tests.yml and one docstring say what the package job's steps do and cover
    (cherry picked from commit 2120c39d58980a79f74ddc2c020806647e1b5d10)

Part of opensoft/openRepoTools#275.

Lane: openRepoTools-2
Co-Authored-By: Claude Sonnet 5.5 [email protected]

🤖 Generated with Claude Code

Summary by Sourcery

Strengthen package workflow contract tests so wheel validation, offline installation checks, and shared lock requirements cannot lose coverage unnoticed.

New Features:

  • Expand workflow tests to execute the package job’s offline install validation and cover additional invalid wheel contents.

Bug Fixes:

  • Prevent package-job checks from being silently weakened while the test suite remains green by validating step 10 output and receipt handling end to end.

Enhancements:

  • Keep the build and pipx lock tomli requirements synchronized through an explicit test.
  • Improve workflow-test coverage for duplicate wheel members, missing or altered files, and malformed install receipts.

Tests:

  • Add coverage for four additional wheel validation cases and complete step 10 output and receipt cases.

Brett Heap and others added 2 commits November 7, 2026 18:18
…te-member check, count line and 28 receipt rows can no longer be removed with the suite green: tests/test_tests_workflow.py runs the wheel check on four more wheels and step 10 whole on a stand-in for pipx's link (#275)

Lane 3's review of #267 measured these survivors in tests.yml: M12 (the
"nothing else" check off), M13 (modules and the stamp never compared), M14
(the duplicate-member check off), M21 (the count line never looked for), M22
(both `-ne 28` made `-ne 29`) and M34 (the stamp's compare skipped for the
stamp). On this base, with the old test file, all five of M12, M13, M14, M21
and M22 applied together are still `-k test_tests_workflow` at 30 passed.

What holds them now, in tests/test_tests_workflow.py:
- Step 6's wheel check runs on four more wheels (WHEEL_CASES): a module with a
  byte changed, the stamp with a line added, a member nothing lists, and a
  member written twice (write_wheel's `again`, since a dict of members cannot
  say it). Each must exit 1 with an `::error::` line that names the file, and
  must not crash: a check 6 removed whole ends in `KeyError:
  'openrepotools/extra.py'`, which names the file too, and the old assertion
  took it for a refusal.
- Step 10 runs whole, offline, on a stand-in for pipx's link, a symlink to a
  /bin/sh script that prints the lines and writes the receipt a case gives it.
  It passes the skip line and the count line once each with 28 rows, and
  refuses a missing skip line, a missing or repeated count line, a receipt of
  27 or 29 rows, and one of 28 or 27 rows with a line that is no row, so each
  half of the row check is held. It skips where `stat -c` and `sha256sum`, which
  the step reads its link with, are not GNU's.
- The three static step 10 checks that read the skip line's words, the count
  line's words and the number 28 are relabelled for what they read, and say
  that the run holds the rest.

tests.yml changes in one comment, which no longer counts the wheels.

Removal proof, each mutant of tests.yml applied alone to a private clone and
run against the new tests with tests/run.sh, LANES_* and TMUX* unset:
- M34: wheel_check_refuses[stamp-line] fails, `AssertionError: exit 0`;
- M13: [module-byte] and [stamp-line] fail; modules alone: [module-byte];
- M12, silent and block-removed: [extra-member] fails; the removed block
  crashes with that KeyError and fails the traceback assertion;
- M14: [member-twice] fails;
- M21: install_step[no-count-line] and [count-line-twice] fail; the skip
  line's half: [no-skip-line];
- M22: [as-printed] and [29-rows] fail; each half of the row check dropped:
  [27-rows-and-a-line-that-is-no-row] and [28-rows-and-a-line-that-is-no-row].
All five together against the new tests: 8 failed, 34 passed. Unmutated,
`-k test_tests_workflow`: 42 passed (30 before, 12 new).

contracts/workflows.md, which fixed the four wheels, is the next commit.

Lane: openRepoTools-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
(cherry picked from commit 5b87b2653f00c978d07db40e8709c010e24bd908)
… lock and tests/test_tests_workflow.py holds the two entries equal, and two comments in tests.yml and one docstring say what the package job's steps do and cover (#275)

Lane 3's re-check of #228's pull request 2 left three NITs for v1.2.0, listed
at the end of this issue, and RV-C's review of this branch (SHOULD S2, and the
NITs N1 and N6) found them still standing at 8151c41, with two wording slips
of this branch's own.
- .github/release-pipx-requirements.txt: the header never named tomli. It now
  says that tomli is also the build lock's entry, because the package job
  installs that lock's first (step 4) and this whole lock after the two builds
  and the wheel check (step 7), and that the two entries move together.
- tests/test_tests_workflow.py: no test compared the two locks' tomli entries.
  test_tests_yml_pipx_lock_carries_the_build_locks_own_tomli_entry holds the
  pipx lock's entry equal to the build lock's, its requirement line (version
  and marker) and every digest. It reads two text files and needs no submodule.
- .github/workflows/tests.yml, step 4's comment: it read as if pytest were
  installed after step 7. It now says what the steps do, in their order: step
  4 installs tomli by hash and then pytest, which keeps that tomli; step 7,
  after the two builds and the wheel check, installs the whole pipx lock by
  hash, which carries the same entry; the package's tests (step 11) run on the
  pipx lock's.
- .github/workflows/tests.yml, step 6's comment (RV-C's N1): "one for each way
  the check refuses a wheel" claimed more than the cases hold. No case changes
  a byte of LICENSE or the payload's file-type bits, and #278's setuid,
  setgid, sticky and type cases are in test_release_workflow.py. It now says
  what contracts/workflows.md says: four more wheels, one for each check the
  first four never reach.
- tests/test_tests_workflow.py, the step 10 test's docstring (RV-C's N6): it
  left out the case of 27 rows and a line that is no row.

Comments, a docstring and one new test: the lines of tests.yml and of the pipx
lock that are not comments hash the same before and after.

Left open, and not this commit's: RV-C's N5, that step 10's run holds the two
lines and the row count but has no case for the exit-status refusal, the
missing-receipt refusal, the link-unchanged refusal or a skip line printed
twice. The contract claims only what the run holds.

Part of #275.

Lane: openRepoTools-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
(cherry picked from commit 2120c39d58980a79f74ddc2c020806647e1b5d10)
@sourcery-ai

sourcery-ai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Clarify how the package job installs and uses the shared tomli entry and which additional wheel cases its check covers.

  • .github/workflows/tests.yml L245-250, L322-325

Tests

Expand synthetic wheel coverage and require the wheel check to reject malformed modules, stamps, unexpected members, and duplicate members without crashing.

  • tests/test_tests_workflow.py L236-245, L772-781, L799-814 (+11 small edits)

Run package step 10 against an offline pipx-link stand-in and assert its status lines, receipt row count, and refusal cases.

  • tests/test_tests_workflow.py L256-269, L1248-1258, L1307-1411 (+5 small edits)

Assert that the pipx and build locks carry the same tomli requirement and hashes.

  • tests/test_tests_workflow.py L82, L220-225, L971-990

Lock files and vendored code

Update the pipx requirements lock header to identify its shared tomli entry.

  • .github/release-pipx-requirements.txt L15-23

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Nov 8, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

brettheap and others added 2 commits November 9, 2026 13:09
The in-place merge of runbook v9: the stack grows by this clean merge, with no force-push.

Lane: openRepoTools-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The in-place merge of runbook v9: the stack grows by this clean merge, with no force-push.

Lane: openRepoTools-2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

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.

1 participant