]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Flag missing pairwise testing markers
authorMichał Kępień <michal@isc.org>
Mon, 18 Jan 2021 13:57:47 +0000 (14:57 +0100)
committerMichał Kępień <michal@isc.org>
Mon, 18 Jan 2021 13:57:47 +0000 (14:57 +0100)
Make the Danger GitLab CI job fail when a merge request adds a new
./configure switch without also adding a "# [pairwise: ...]" marker that
the relevant GitLab CI job uses for preparing the pairwise testing
model.  This helps to ensure that any newly added ./configure switches
are tested by the pairwise testing GitLab CI job.

dangerfile.py

index df1ae1a8e1d276c7b533f6ddc36fc0e3d4428fcb..7cec7162ccdc3efd78c952222fadc6afa3d78c01 100644 (file)
@@ -238,3 +238,18 @@ if lines_containing(changes_added_lines, '[security]'):
     if not lines_containing(notes_added_lines, 'CVE-20'):
         fail('This merge request fixes a security issue. '
              'Please add a release note which includes a CVE identifier.')
+
+###############################################################################
+# PAIRWISE TESTING
+###############################################################################
+#
+# FAIL if the merge request adds any new ./configure switch without an
+# associated annotation used for pairwise testing.
+
+configure_added_lines = added_lines(target_branch, ['configure.ac'])
+switches_added = (lines_containing(configure_added_lines, 'AC_ARG_ENABLE') +
+                  lines_containing(configure_added_lines, 'AC_ARG_WITH'))
+annotations_added = lines_containing(configure_added_lines, '# [pairwise: ')
+if len(switches_added) > len(annotations_added):
+    fail('This merge request adds at least one new `./configure` switch that '
+         'is not annotated for pairwise testing purposes.')