In Katello, we recently had our master branch failing in jenkins, due to failures in eslint and react snapshot tests.
This, of course, is inconvenient as it blocks all other PRs from passing jenkins and being merged. Theoretically, if these tests are being run on all PRs, the tests should never be broken on master.
The issue is we have PRs who have had tests ran a while ago and passed, but since then, master has changed quite a bit. The tests will fail once the PR is merged and rebased.
I have an example of this PR, which introduced some unused import eslint errors. From what I can tell on the PR, the tests ran on August 9th (and presumably passed), but it was merged yesterday. In this time period, master had changed quite a bit and once it was rebased into master, some tests were failing. (Iām in no way pointing fingers at anyone involved in the PR, everyone used the correct workflow for our current process, it just happens to be a good example)
We had a similar breakage a few weeks ago, they seem to happen in our React code since its changing so fast (which is a good thing!)
This can be easily avoided if we invalidate jenkins builds or require them to be run again after a certain time period. This would ensure that the PR ran with the latest master branch and was merged shortly after. My preference would be a week, but that is something we can discuss and/or vote on if we decide to go this route.
I realize something could change within the allotted time period even if its small, but I think we can prevent the vast majority of these cases even with a generous time of keeping jenkins builds valid.
My initial questions are:
- Is invalidating a jenkins build or similar something we would like to consider?
- Do we think it would help keep master from breaking?
- Is this possible technically within jenkins and/or github?
I can create polls and such, but would like to get some initial feedback first from those who are more familiar with our test automation.
Looking forward to hearing your opinions, thanks!