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
@@ -19,6 +19,8 @@ package org.springframework.web.bind;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.build.junit.Assume;
|
||||
import org.springframework.build.junit.TestGroup;
|
||||
import org.springframework.mock.web.test.MockHttpServletRequest;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
||||
@@ -399,6 +401,7 @@ public class ServletRequestUtilsTests {
|
||||
|
||||
@Test
|
||||
public void testGetLongParameterWithDefaultValueHandlingIsFastEnough() {
|
||||
Assume.group(TestGroup.PERFORMANCE);
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
StopWatch sw = new StopWatch();
|
||||
sw.start();
|
||||
@@ -412,6 +415,7 @@ public class ServletRequestUtilsTests {
|
||||
|
||||
@Test
|
||||
public void testGetFloatParameterWithDefaultValueHandlingIsFastEnough() {
|
||||
Assume.group(TestGroup.PERFORMANCE);
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
StopWatch sw = new StopWatch();
|
||||
sw.start();
|
||||
@@ -425,6 +429,7 @@ public class ServletRequestUtilsTests {
|
||||
|
||||
@Test
|
||||
public void testGetDoubleParameterWithDefaultValueHandlingIsFastEnough() {
|
||||
Assume.group(TestGroup.PERFORMANCE);
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
StopWatch sw = new StopWatch();
|
||||
sw.start();
|
||||
@@ -438,6 +443,7 @@ public class ServletRequestUtilsTests {
|
||||
|
||||
@Test
|
||||
public void testGetBooleanParameterWithDefaultValueHandlingIsFastEnough() {
|
||||
Assume.group(TestGroup.PERFORMANCE);
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
StopWatch sw = new StopWatch();
|
||||
sw.start();
|
||||
@@ -451,6 +457,7 @@ public class ServletRequestUtilsTests {
|
||||
|
||||
@Test
|
||||
public void testGetStringParameterWithDefaultValueHandlingIsFastEnough() {
|
||||
Assume.group(TestGroup.PERFORMANCE);
|
||||
MockHttpServletRequest request = new MockHttpServletRequest();
|
||||
StopWatch sw = new StopWatch();
|
||||
sw.start();
|
||||
|
||||
Reference in New Issue
Block a user