2 ms·
I do not agree with the "test failing is normal" or flaky tests parts at all. CI pipe should be green all of the time. Why would you add failing tests for miss
by nextlevelwizard 4y ago
I do not agree with the "test failing is normal" or flaky tests parts at all.
CI pipe should be green all of the time. Why would you add failing tests for missing features before the feature? New tests should be merged in with the feature/bug fix. If a test start failing marking it as failing is a huge smell. Yes it will stop everyone from pushing, but that is how it should be. Everyone should be mobilized to figure out why the tests are failing and either reverting commits or fixing shit until we are back in green and normal work can continue.
Same goes for flaky (a.k.a. bad) tests. You shouldn't run any kind of heuristics on failure rates to figure out if regression has happened it should be obvious from the state of the test (output should be binary). If a test fails randomly it means that your test is bad and it needs to be fixed. Sometimes this means implementing better instrumentation, sometimes it means doing "hard" stuff that previous test writer skipped, sometimes it requires completely rethinking how a feature should be tested.