Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public abstract class UnifiedTest {
private UnifiedTestContext rootContext;
private boolean ignoreExtraEvents;
private BsonDocument startingClusterTime;
@Nullable
private TestDef testDef;

private class UnifiedTestContext {
Expand Down Expand Up @@ -215,11 +216,13 @@ public void setUp(
rootContext = new UnifiedTestContext();
rootContext.getAssertionContext().push(ContextElement.ofTest(definition));
ignoreExtraEvents = false;
testDef = testDef(directoryName, fileDescription, testDescription, isReactive());
UnifiedTestModifications.doSkips(testDef);
if (directoryName != null && fileDescription != null && testDescription != null) {
testDef = testDef(directoryName, fileDescription, testDescription, isReactive());
UnifiedTestModifications.doSkips(testDef);

boolean skip = testDef.wasAssignedModifier(UnifiedTestModifications.Modifier.SKIP);
assumeFalse(skip, "Skipping test");
boolean skip = testDef.wasAssignedModifier(UnifiedTestModifications.Modifier.SKIP);
assumeFalse(skip, "Skipping test");
}
skips(fileDescription, testDescription);

assertTrue(
Expand Down Expand Up @@ -268,8 +271,9 @@ public void setUp(
this::createMongoClient,
this::createGridFSBucket,
this::createClientEncryption);

postSetUp(testDef);
if (testDef != null) {
postSetUp(testDef);
}
}

protected void postSetUp(final TestDef def) {
Expand All @@ -281,7 +285,9 @@ public void cleanUp() {
failPoint.disableFailPoint();
}
entities.close();
postCleanUp(testDef);
if (testDef != null) {
postCleanUp(testDef);
}
}

protected void postCleanUp(final TestDef testDef) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ public static final class TestDef {
private final List<Modifier> modifiers = new ArrayList<>();

private TestDef(final String dir, final String file, final String test, final boolean reactive) {
this.dir = dir;
this.file = file;
this.test = test;
this.dir = assertNotNull(dir);
this.file = assertNotNull(file);
this.test = assertNotNull(test);
this.reactive = reactive;
}

Expand Down