What a lockfile bump tests that your code never touched
Originally published at omerbinsaleem.com by Omer Bin Saleem (Omer Saleem). A dependency patch with no source edits turned our pipeline from the affected tests into the whole suite. The failures it printed were real, an
Originally published at omerbinsaleem.com by Omer Bin Saleem (Omer Saleem).
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
- 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.
- 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.
- 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.
- 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.
- 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.
I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at omerbinsaleem.com. LinkedIn: omer-bin-saleem Β· Instagram: @iomerbinsaleem.
Written with AI assistance, from my own work notes.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.