From 5ce2e44a3650b4aa02edbc3766cd10fe0c5ac088 Mon Sep 17 00:00:00 2001 From: "A.J. Beamon" Date: Thu, 26 Aug 2021 12:20:09 -0700 Subject: [PATCH] Unit tests require a match from the test pattern in order to be successful. This avoids cases where a typo in the pattern might lead one to believe that their tests were all successful. --- fdbserver/workloads/UnitTests.actor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fdbserver/workloads/UnitTests.actor.cpp b/fdbserver/workloads/UnitTests.actor.cpp index b9b792afe4..b361115645 100644 --- a/fdbserver/workloads/UnitTests.actor.cpp +++ b/fdbserver/workloads/UnitTests.actor.cpp @@ -110,7 +110,15 @@ struct UnitTestWorkload : TestWorkload { tests.push_back(test); } } + fprintf(stdout, "Found %zu tests\n", tests.size()); + + if (tests.size() == 0) { + TraceEvent(SevError, "NoMatchingUnitTests").detail("TestPattern", self->testPattern); + ++self->testsFailed; + return Void(); + } + deterministicRandom()->randomShuffle(tests); if (self->testRunLimit > 0 && tests.size() > self->testRunLimit) tests.resize(self->testRunLimit);