Ignore performance-sensitive tests by default
Make use of the new JUnit functionality introduced in the previous commit to 'Assume' that perfomance- and timing-sensitive tests should run only when TestGroup.PERFORMANCE is selected, i.e. when -PtestGroups="performance" has been provided at the Gradle command line. The net effect is that these tests are now ignored by default, which will result in far fewer false-negative CI build failures due to resource contention and other external factors that cause slowdowns. We will set up a dedicated performance CI build to run these tests on an isolated machine, etc. Issue: SPR-9984
This commit is contained in:
committed by
Chris Beams
parent
b083bbdec7
commit
60032e0012
@@ -35,6 +35,8 @@ import java.util.UUID;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.build.junit.Assume;
|
||||
import org.springframework.build.junit.TestGroup;
|
||||
import org.springframework.core.convert.ConversionFailedException;
|
||||
import org.springframework.core.convert.ConverterNotFoundException;
|
||||
import org.springframework.core.convert.TypeDescriptor;
|
||||
@@ -398,6 +400,7 @@ public class GenericConversionServiceTests {
|
||||
|
||||
@Test
|
||||
public void testPerformance1() {
|
||||
Assume.group(TestGroup.PERFORMANCE);
|
||||
GenericConversionService conversionService = new DefaultConversionService();
|
||||
StopWatch watch = new StopWatch("integer->string conversionPerformance");
|
||||
watch.start("convert 4,000,000 with conversion service");
|
||||
@@ -415,6 +418,7 @@ public class GenericConversionServiceTests {
|
||||
|
||||
@Test
|
||||
public void testPerformance2() throws Exception {
|
||||
Assume.group(TestGroup.PERFORMANCE);
|
||||
GenericConversionService conversionService = new DefaultConversionService();
|
||||
StopWatch watch = new StopWatch("list<string> -> list<integer> conversionPerformance");
|
||||
watch.start("convert 4,000,000 with conversion service");
|
||||
@@ -442,6 +446,7 @@ public class GenericConversionServiceTests {
|
||||
|
||||
@Test
|
||||
public void testPerformance3() throws Exception {
|
||||
Assume.group(TestGroup.PERFORMANCE);
|
||||
GenericConversionService conversionService = new DefaultConversionService();
|
||||
StopWatch watch = new StopWatch("map<string, string> -> map<string, integer> conversionPerformance");
|
||||
watch.start("convert 4,000,000 with conversion service");
|
||||
|
||||
Reference in New Issue
Block a user