From 9f6bb3563d7a311a7e5628d18210c2c263af962d Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Thu, 7 Jan 2021 13:57:35 -0700 Subject: CI: smoke test: insist on adding tests on PRs On each PR (with a few exceptions), check the list of git-touched files, and abort if no tests are added. Include instructions on how to bypass the check if tests really aren't needed. Include a hardcoded exception list for PRs that only touch a well-known subset of "safe" files: docs, .cirrus.yml, vendor, version, hack, contrib, or *.md. This list is likely to need tuning over time. Add a test suite, but not one recognized by the new script (because it's a "*.t" file), so: [NO TESTS NEEDED] Signed-off-by: Ed Santiago --- CONTRIBUTING.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'CONTRIBUTING.md') diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 30fddf82b..cb8bce9ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -142,9 +142,13 @@ larger PRs into smaller ones - it's easier to review smaller code changes. But only if those smaller ones make sense as stand-alone PRs. Regardless of the type of PR, all PRs should include: -* well documented code changes -* additional testcases. Ideally, they should fail w/o your code change applied -* documentation changes +* well documented code changes. +* additional testcases. Ideally, they should fail w/o your code change applied. + (With a few exceptions, CI hooks will block your PR unless your change + includes files named `*_test.go` or under the `test/` subdirectory. To + bypass this block, include the string `[NO TESTS NEEDED]` in your + commit message). +* documentation changes. Squash your commits into logical pieces of work that might want to be reviewed separate from the rest of the PRs. But, squashing down to just one commit is ok -- cgit v1.2.3-54-g00ecf