Merge pull request #5474 from sfc-gh-ajbeamon/unit-tests-require-match

Unit tests require a match from the test pattern in order to be successful
This commit is contained in:
A.J. Beamon 2021-08-27 09:17:23 -07:00 committed by GitHub
commit d706a7ddd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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);