Skip to content

Avoid using test groups for test ordering #649

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 1 commit into from
Oct 3, 2024
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 @@ -112,7 +112,7 @@ private CompletableFuture<Void> newWaitingFuture() {
return result;
}

@Test(groups = "main")
@Test
public void bulkheadMetricTest() throws InterruptedException, ExecutionException, TimeoutException {
TelemetryMetricGetter m = new TelemetryMetricGetter(BulkheadMetricBean.class, "waitFor");
m.baselineMetrics();
Expand Down Expand Up @@ -145,7 +145,7 @@ public void bulkheadMetricTest() throws InterruptedException, ExecutionException
is(0L));
}

@Test(groups = "main")
@Test
public void bulkheadMetricRejectionTest() throws InterruptedException, ExecutionException, TimeoutException {
TelemetryMetricGetter m = new TelemetryMetricGetter(BulkheadMetricBean.class, "waitFor");
m.baselineMetrics();
Expand Down Expand Up @@ -178,7 +178,7 @@ public void bulkheadMetricRejectionTest() throws InterruptedException, Execution

}

@Test(groups = "main")
@Test
public void bulkheadMetricHistogramTest() throws InterruptedException, ExecutionException, TimeoutException {
TelemetryMetricGetter m = new TelemetryMetricGetter(BulkheadMetricBean.class, "waitForHistogram");
m.baselineMetrics();
Expand Down Expand Up @@ -217,7 +217,7 @@ public void bulkheadMetricHistogramTest() throws InterruptedException, Execution
m.getBulkheadRunningDuration().assertBoundaries();
}

@Test(groups = "main")
@Test
public void bulkheadMetricAsyncTest() throws InterruptedException, ExecutionException, TimeoutException {
TelemetryMetricGetter m = new TelemetryMetricGetter(BulkheadMetricBean.class, "waitForAsync");
m.baselineMetrics();
Expand Down Expand Up @@ -265,7 +265,8 @@ public void bulkheadMetricAsyncTest() throws InterruptedException, ExecutionExce
is(1L));
}

@Test(dependsOnGroups = "main")
@Test(dependsOnMethods = {"bulkheadMetricTest", "bulkheadMetricRejectionTest", "bulkheadMetricHistogramTest",
"bulkheadMetricAsyncTest"})
public void testMetricUnits() throws InterruptedException, ExecutionException {
InMemoryMetricReader reader = InMemoryMetricReader.current();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void closeTheCircuit() throws Exception {
}
}

@Test(groups = "main")
@Test
public void testCircuitBreakerMetric() throws Exception {
TelemetryMetricGetter m = new TelemetryMetricGetter(CircuitBreakerMetricBean.class, "doWork");

Expand Down Expand Up @@ -181,7 +181,7 @@ public void testCircuitBreakerMetric() throws Exception {
is(5L));
}

@Test(dependsOnGroups = "main")
@Test(dependsOnMethods = "testCircuitBreakerMetric")
public void testMetricUnits() throws InterruptedException, ExecutionException {
InMemoryMetricReader reader = InMemoryMetricReader.current();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static WebArchive deploy() {
@Inject
private FallbackMetricBean fallbackBean;

@Test(groups = "main")
@Test
public void fallbackMetricMethodTest() {
TelemetryMetricGetter m = new TelemetryMetricGetter(FallbackMetricBean.class, "doWork");
m.baselineMetrics();
Expand Down Expand Up @@ -124,7 +124,7 @@ public void fallbackMetricMethodTest() {
is(1L));
}

@Test(groups = "main")
@Test
public void fallbackMetricHandlerTest() {
TelemetryMetricGetter m = new TelemetryMetricGetter(FallbackMetricBean.class, "doWorkWithHandler");
m.baselineMetrics();
Expand Down Expand Up @@ -177,7 +177,7 @@ public void fallbackMetricHandlerTest() {
is(1L));
}

@Test(dependsOnGroups = "main")
@Test(dependsOnMethods = {"fallbackMetricMethodTest", "fallbackMetricHandlerTest"})
public void testMetricUnits() throws InterruptedException, ExecutionException {
InMemoryMetricReader reader = InMemoryMetricReader.current();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static WebArchive deploy() {
@Inject
private RetryMetricBean retryBean;

@Test(groups = "main")
@Test
public void testRetryMetricSuccessfulImmediately() {
TelemetryMetricGetter m = new TelemetryMetricGetter(RetryMetricBean.class, "failSeveralTimes");
m.baselineMetrics();
Expand All @@ -103,7 +103,7 @@ public void testRetryMetricSuccessfulImmediately() {
m.getInvocations(EXCEPTION_THROWN, InvocationFallback.NOT_DEFINED).delta(), is(0L));
}

@Test(groups = "main")
@Test
public void testRetryMetricSuccessfulAfterRetry() {
TelemetryMetricGetter m = new TelemetryMetricGetter(RetryMetricBean.class, "failSeveralTimes");
m.baselineMetrics();
Expand All @@ -119,7 +119,7 @@ public void testRetryMetricSuccessfulAfterRetry() {
m.getInvocations(EXCEPTION_THROWN, InvocationFallback.NOT_DEFINED).delta(), is(0L));
}

@Test(groups = "main")
@Test
public void testRetryMetricNonRetryableImmediately() {
TelemetryMetricGetter m = new TelemetryMetricGetter(RetryMetricBean.class, "failSeveralTimesThenNonRetryable");
m.baselineMetrics();
Expand All @@ -137,7 +137,7 @@ public void testRetryMetricNonRetryableImmediately() {
m.getInvocations(EXCEPTION_THROWN, InvocationFallback.NOT_DEFINED).delta(), is(1L));
}

@Test(groups = "main")
@Test
public void testRetryMetricNonRetryableAfterRetries() {
TelemetryMetricGetter m = new TelemetryMetricGetter(RetryMetricBean.class, "failSeveralTimesThenNonRetryable");
m.baselineMetrics();
Expand All @@ -155,7 +155,7 @@ public void testRetryMetricNonRetryableAfterRetries() {
m.getInvocations(EXCEPTION_THROWN, InvocationFallback.NOT_DEFINED).delta(), is(1L));
}

@Test(groups = "main")
@Test
public void testRetryMetricMaxRetries() {
TelemetryMetricGetter m = new TelemetryMetricGetter(RetryMetricBean.class, "failSeveralTimes");
m.baselineMetrics();
Expand All @@ -172,7 +172,7 @@ public void testRetryMetricMaxRetries() {
m.getInvocations(EXCEPTION_THROWN, InvocationFallback.NOT_DEFINED).delta(), is(2L));
}

@Test(groups = "main")
@Test
public void testRetryMetricMaxRetriesHitButNoRetry() {
// This is an edge case which can only occur when maxRetries = 0
TelemetryMetricGetter m = new TelemetryMetricGetter(RetryMetricBean.class, "maxRetriesZero");
Expand All @@ -189,7 +189,7 @@ public void testRetryMetricMaxRetriesHitButNoRetry() {
m.getInvocations(EXCEPTION_THROWN, InvocationFallback.NOT_DEFINED).delta(), is(1L));
}

@Test(groups = "main")
@Test
public void testRetryMetricMaxDuration() {
TelemetryMetricGetter m = new TelemetryMetricGetter(RetryMetricBean.class, "failAfterDelay");
m.baselineMetrics();
Expand All @@ -206,7 +206,7 @@ public void testRetryMetricMaxDuration() {
m.getInvocations(EXCEPTION_THROWN, InvocationFallback.NOT_DEFINED).delta(), is(1L));
}

@Test(groups = "main")
@Test
public void testRetryMetricMaxDurationNoRetries() {
TelemetryMetricGetter m = new TelemetryMetricGetter(RetryMetricBean.class, "failAfterDelay");
m.baselineMetrics();
Expand All @@ -224,7 +224,10 @@ public void testRetryMetricMaxDurationNoRetries() {
m.getInvocations(EXCEPTION_THROWN, InvocationFallback.NOT_DEFINED).delta(), is(1L));
}

@Test(dependsOnGroups = "main")
@Test(dependsOnMethods = {"testRetryMetricSuccessfulImmediately", "testRetryMetricSuccessfulAfterRetry",
"testRetryMetricNonRetryableImmediately", "testRetryMetricNonRetryableAfterRetries",
"testRetryMetricMaxRetries", "testRetryMetricMaxRetriesHitButNoRetry", "testRetryMetricMaxDuration",
"testRetryMetricMaxDurationNoRetries"})
public void testMetricUnits() throws InterruptedException, ExecutionException {
InMemoryMetricReader reader = InMemoryMetricReader.current();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static WebArchive deploy() {
@Inject
private TimeoutMetricBean timeoutBean;

@Test(groups = "main")
@Test
public void testTimeoutMetric() {
TelemetryMetricGetter m = new TelemetryMetricGetter(TimeoutMetricBean.class, "counterTestWorkForMillis");
m.baselineMetrics();
Expand All @@ -104,7 +104,7 @@ public void testTimeoutMetric() {
is(2L));
}

@Test(groups = "main")
@Test
public void testTimeoutHistogram() {
TelemetryMetricGetter m = new TelemetryMetricGetter(TimeoutMetricBean.class, "histogramTestWorkForMillis");

Expand All @@ -117,7 +117,7 @@ public void testTimeoutHistogram() {
m.getTimeoutExecutionDuration().assertBoundaries();
}

@Test(dependsOnGroups = "main")
@Test(dependsOnMethods = {"testTimeoutMetric", "testTimeoutHistogram"})
public void testMetricUnits() throws InterruptedException, ExecutionException {
InMemoryMetricReader reader = InMemoryMetricReader.current();

Expand Down
Loading