Remove TestGroup.PERFORMANCE
Now that there's a new JMH infrastructure for benchmarks and that performance tests have been rewritten to use it, we should remove the `PERFORMANCE` `TestGroup` to avoid introducing such tests in the future. Closes gh-24830
This commit is contained in:
parent
61d893257e
commit
e33e7d7681
|
|
@ -50,21 +50,21 @@ class TestGroupParsingTests {
|
|||
|
||||
@Test
|
||||
void parseWithSpaces() {
|
||||
assertThat(TestGroup.parse(" PERFORMANCE, PERFORMANCE ")).containsOnly(TestGroup.PERFORMANCE);
|
||||
assertThat(TestGroup.parse(" LONG_RUNNING, LONG_RUNNING ")).containsOnly(TestGroup.LONG_RUNNING);
|
||||
}
|
||||
|
||||
@Test
|
||||
void parseInMixedCase() {
|
||||
assertThat(TestGroup.parse("performance, PERFormaNCE")).containsOnly(TestGroup.PERFORMANCE);
|
||||
assertThat(TestGroup.parse("long_running, LonG_RunnING")).containsOnly(TestGroup.LONG_RUNNING);
|
||||
}
|
||||
|
||||
@Test
|
||||
void parseMissing() {
|
||||
assertThatIllegalArgumentException()
|
||||
.isThrownBy(() -> TestGroup.parse("performance, missing"))
|
||||
.isThrownBy(() -> TestGroup.parse("long_running, missing"))
|
||||
.withMessageContaining("Unable to find test group 'missing' when parsing " +
|
||||
"testGroups value: 'performance, missing'. Available groups include: " +
|
||||
"[LONG_RUNNING,PERFORMANCE]");
|
||||
"testGroups value: 'long_running, missing'. Available groups include: " +
|
||||
"[LONG_RUNNING]");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -73,10 +73,10 @@ class TestGroupParsingTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
void parseAllExceptPerformance() {
|
||||
void parseAllExceptLongRunning() {
|
||||
Set<TestGroup> expected = EnumSet.allOf(TestGroup.class);
|
||||
expected.remove(TestGroup.PERFORMANCE);
|
||||
assertThat(TestGroup.parse("all-performance")).isEqualTo(expected);
|
||||
expected.remove(TestGroup.LONG_RUNNING);
|
||||
assertThat(TestGroup.parse("all-long_running")).isEqualTo(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -85,7 +85,7 @@ class TestGroupParsingTests {
|
|||
.isThrownBy(() -> TestGroup.parse("all-missing"))
|
||||
.withMessageContaining("Unable to find test group 'missing' when parsing " +
|
||||
"testGroups value: 'all-missing'. Available groups include: " +
|
||||
"[LONG_RUNNING,PERFORMANCE]");
|
||||
"[LONG_RUNNING]");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
|||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
import static org.springframework.core.testfixture.TestGroup.LONG_RUNNING;
|
||||
import static org.springframework.core.testfixture.TestGroup.PERFORMANCE;
|
||||
|
||||
/**
|
||||
* Tests for {@link TestGroup}.
|
||||
|
|
@ -68,12 +67,6 @@ class TestGroupTests {
|
|||
assertThatExceptionOfType(TestAbortedException.class).isThrownBy(() -> assumeGroup(LONG_RUNNING));
|
||||
}
|
||||
|
||||
@Test
|
||||
void assumeGroupWithNoMatchingActiveTestGroup() {
|
||||
setTestGroups(PERFORMANCE);
|
||||
assertThatExceptionOfType(TestAbortedException.class).isThrownBy(() -> assumeGroup(LONG_RUNNING));
|
||||
}
|
||||
|
||||
@Test
|
||||
void assumeGroupWithMatchingActiveTestGroup() {
|
||||
setTestGroups(LONG_RUNNING);
|
||||
|
|
@ -107,7 +100,7 @@ class TestGroupTests {
|
|||
.isInstanceOf(IllegalArgumentException.class)
|
||||
.withMessage(
|
||||
"Unable to find test group 'bogus' when parsing testGroups value: '" + testGroups +
|
||||
"'. Available groups include: [LONG_RUNNING,PERFORMANCE]");
|
||||
"'. Available groups include: [LONG_RUNNING]");
|
||||
}
|
||||
|
||||
private void setTestGroups(TestGroup... testGroups) {
|
||||
|
|
|
|||
|
|
@ -40,15 +40,7 @@ public enum TestGroup {
|
|||
* 500ms should be considered a candidate in order to avoid making the overall test
|
||||
* suite too slow to run during the normal development cycle.
|
||||
*/
|
||||
LONG_RUNNING,
|
||||
|
||||
/**
|
||||
* Performance-related tests that may fail unpredictably based on CPU profile and load.
|
||||
* Any test using {@link Thread#sleep}, {@link Object#wait}, Spring's
|
||||
* {@code StopWatch}, etc. should be considered a candidate as their successful
|
||||
* execution is likely to be based on events occurring within a given time window.
|
||||
*/
|
||||
PERFORMANCE;
|
||||
LONG_RUNNING;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue