Don't take into account commit message for skip-if filter
If there is some skip-if condition containing all-files-match-any, then
Zuul skips jobs for changes without modified files (merge commits),
because it always matches '/COMMIT_MSG'.
So test files for regexes only if CR has more than one modified file,
because '/COMMIT_MSG' is always included even for empty merge commits.
Change-Id: Iad78d9eb8212beea3238728321c1ba74efa991e2
diff --git a/tests/test_change_matcher.py b/tests/test_change_matcher.py
index 1f4ab93..0585322 100644
--- a/tests/test_change_matcher.py
+++ b/tests/test_change_matcher.py
@@ -123,13 +123,13 @@
self._test_matches(False)
def test_matches_returns_false_when_not_all_files_match(self):
- self._test_matches(False, files=['docs/foo', 'foo/bar'])
+ self._test_matches(False, files=['/COMMIT_MSG', 'docs/foo', 'foo/bar'])
- def test_matches_returns_true_when_commit_message_matches(self):
- self._test_matches(True, files=['/COMMIT_MSG'])
+ def test_matches_returns_false_when_commit_message_matches(self):
+ self._test_matches(False, files=['/COMMIT_MSG'])
def test_matches_returns_true_when_all_files_match(self):
- self._test_matches(True, files=['docs/foo'])
+ self._test_matches(True, files=['/COMMIT_MSG', 'docs/foo'])
class TestMatchAll(BaseTestMatcher):