Menu

Would you merge a PR a bot opened? The flaky-or-real check we run first
📰

Would you merge a PR a bot opened? The flaky-or-real check we run first

DEV Community: cicd·Versyka·about 18 hours ago
#GFxxvXfC
#devtocicd#devto#dev#pull#request
Reading 0:00
15s threshold

Versyka

Posted on Nov 11

AI-assisted

"I'd never merge a pull request a bot opened." It's the first objection we hear about automated upgrades, and it's the right instinct. The answer isn't trust, it's evidence: you need to know whether a red test was caused by the change at all. Here's the routine, by hand first.

A test goes red on a pull request. The usual responses are "rerun the pipeline" or "start debugging". Both skip a cheaper question: is this failure caused by the change at all?

Step 1: rerun only the failed test

pytest tests/test_checkout.py::test_total -x npx jest -t "total is correct"

Enter fullscreen mode

Exit fullscreen mode

Fails, then passes: flaky. A timeout, a race, a test that depends on order, real network or the current time.

Fails twice: probably real. Keep going.

Step 2: run it on main

git stash && git checkout main pytest tests/test_checkout.py::test_total

Enter fullscreen mode

Exit fullscreen mode

If it fails on main too, your change didn't break it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.