Skip to content

Implement tests reordering for TestNG #8467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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 @@ -25,9 +25,9 @@ TestSuiteImpl testSuiteStart(
* @return {@code true} if the test is new, {@code false} if it is an existing test <b>or if the
* list of known tests is not available</b>.
*/
boolean isNew(TestIdentifier test);
boolean isNew(@Nonnull TestIdentifier test);

boolean isFlaky(TestIdentifier test);
boolean isFlaky(@Nonnull TestIdentifier test);

boolean isModified(TestSourceData testSourceData);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.function.Consumer;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -190,6 +191,7 @@ private void populateSourceDataTags(
}
}

@Nonnull
public TestIdentifier getIdentifier() {
return identifier;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ public ProxyTestModule(
}

@Override
public boolean isNew(TestIdentifier test) {
public boolean isNew(@Nonnull TestIdentifier test) {
return executionStrategy.isNew(test);
}

@Override
public boolean isFlaky(TestIdentifier test) {
public boolean isFlaky(@Nonnull TestIdentifier test) {
return executionStrategy.isFlaky(test);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ public HeadlessTestModule(
}

@Override
public boolean isNew(TestIdentifier test) {
public boolean isNew(@Nonnull TestIdentifier test) {
return executionStrategy.isNew(test);
}

@Override
public boolean isFlaky(TestIdentifier test) {
public boolean isFlaky(@Nonnull TestIdentifier test) {
return executionStrategy.isFlaky(test);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ public TestExecutionPolicy executionPolicy(TestIdentifier test, TestSourceData s
}

@Override
public boolean isNew(TestIdentifier test) {
public boolean isNew(@Nonnull TestIdentifier test) {
return false;
}

@Override
public boolean isFlaky(TestIdentifier test) {
public boolean isFlaky(@Nonnull TestIdentifier test) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ public TestExecutionPolicy executionPolicy(TestIdentifier test, TestSourceData t
}

@Override
public boolean isNew(TestIdentifier test) {
public boolean isNew(@Nonnull TestIdentifier test) {
return testModule.isNew(test);
}

@Override
public boolean isFlaky(TestIdentifier test) {
public boolean isFlaky(@Nonnull TestIdentifier test) {
return testModule.isFlaky(test);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public ExecutionSettings getExecutionSettings() {
return executionSettings;
}

public boolean isNew(TestIdentifier test) {
public boolean isNew(@Nonnull TestIdentifier test) {
return executionSettings.isKnownTestsDataAvailable()
&& !executionSettings.isKnown(test.toFQN());
}

public boolean isFlaky(TestIdentifier test) {
public boolean isFlaky(@Nonnull TestIdentifier test) {
return executionSettings.isFlaky(test.toFQN());
}

Expand Down Expand Up @@ -163,7 +163,7 @@ private boolean isAutoRetryApplicable(TestIdentifier test) {
&& autoRetriesUsed.get() < config.getCiVisibilityTotalFlakyRetryCount();
}

private boolean isEFDApplicable(TestIdentifier test, TestSourceData testSource) {
private boolean isEFDApplicable(@Nonnull TestIdentifier test, TestSourceData testSource) {
EarlyFlakeDetectionSettings efdSettings = executionSettings.getEarlyFlakeDetectionSettings();
return efdSettings.isEnabled()
&& !isEFDLimitReached()
Expand Down
Loading
Loading