From 37347c3216a1e613f470fbd933a4257f472b3d2f Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Mon, 4 Oct 2021 19:12:58 -0600 Subject: It really should be no **NEW** tests needed Accept both "NO TESTS NEEDED" and "NO NEW TESTS NEEDED". That was a usability mistake I made on Day One. Fixed it in Buildah but oops never got around to fixing it here. Also, fix the test suite script: remove a no-longer-working test case (changelog.txt, removed in #11467) and add a new test for commits that include the magic string. Signed-off-by: Ed Santiago --- contrib/cirrus/pr-should-include-tests | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'contrib/cirrus/pr-should-include-tests') diff --git a/contrib/cirrus/pr-should-include-tests b/contrib/cirrus/pr-should-include-tests index 09ab002cf..4b6329311 100755 --- a/contrib/cirrus/pr-should-include-tests +++ b/contrib/cirrus/pr-should-include-tests @@ -8,7 +8,10 @@ if [[ "${CIRRUS_CHANGE_TITLE}" =~ CI:DOCS ]]; then exit 0 fi -# So are PRs where 'NO TESTS NEEDED' appears in the Github message +# So are PRs where 'NO NEW TESTS NEEDED' appears in the Github message +if [[ "${CIRRUS_CHANGE_MESSAGE}" =~ NO.NEW.TESTS.NEEDED ]]; then + exit 0 +fi if [[ "${CIRRUS_CHANGE_MESSAGE}" =~ NO.TESTS.NEEDED ]]; then exit 0 fi @@ -49,8 +52,11 @@ if [[ -z "$filtered_changes" ]]; then exit 0 fi -# One last chance: perhaps the developer included the magic '[NO TESTS NEEDED]' +# One last chance: perhaps the developer included the magic '[NO (NEW) TESTS NEEDED]' # string in an amended commit. +if git log --format=%B ${base}..${head} | fgrep '[NO NEW TESTS NEEDED]'; then + exit 0 +fi if git log --format=%B ${base}..${head} | fgrep '[NO TESTS NEEDED]'; then exit 0 fi @@ -67,7 +73,7 @@ tests, possibly just adding a small step to a similar existing test. Every second counts in CI. If your commit really, truly does not need tests, you can proceed -by adding '[NO TESTS NEEDED]' to the body of your commit message. +by adding '[NO NEW TESTS NEEDED]' to the body of your commit message. Please think carefully before doing so. EOF -- cgit v1.2.3-54-g00ecf