Subscribe Work with me
← All hacks Testing3 min read

What a lockfile bump tests that your code never touched

A dependency patch with no source edits turned our pipeline from the affected tests into the whole suite. The failures it printed were real, and none of them came from that branch.

How to do it

  1. When the only diff is a lockfile, expect the pipeline to drop its affected-tests shortcut. Our staging and dev runs normally test only what a branch touches, but a lockfile change marks everything as affected, so the full suite ran: 4 shards, about 7,900 tests.
  2. Read the failures as a list before editing anything. Two specs were red, and both had been red on staging for days with nobody noticing: a translation string that no longer matched a term rule, and a spec still expecting a guard that an earlier change had removed.
  3. For each failure, find the commit that changed the expectation. A git log -S on the asserted string tells you whether the break arrived with your branch or landed on the target weeks ago.
  4. Fix the older ones first, then push once. The dependency patch and the two fixes went up together and the branch went fully green, instead of a red pipeline that read as the bump’s fault.
  5. Check the other long lived branch too. Main was clean while staging was not, which is the clearest sign the breaks were never in the dependency, and nothing in the bump itself would have told us that.
Prompt to copy
The only change on my branch is a lockfile bump, no source edits, and CI ran the full test suite instead of the affected tests. Here is the list of failing specs. For each one, find the last commit that changed the expectation being asserted (try git log -S on the asserted string, then the spec file), and tell me whether that commit is on my branch or already on the target branch. Group the failures into mine and older than my branch, with the commit and date for each. Do not edit any test until that split is done.

One AI hack in your inbox, every morning.

Short, practical, with the prompt to copy. Unsubscribe in one click.