INT-3152 Speed Up Build Times

Add a `@Rule` to skip long-runing tests during normal builds.

Add the rule to long-running tests in gemfire, ip, jms, jmx.

Add an environment variable `RUN_LONG_INTEGRATION_TESTS`; when set
to true, all tests are run.

Set the environment variable to true on all nightly builds.

Build now runs in 13 minutes on my 3 year old laptop.

Polishing - Switch to TestWatcher

TestWatchMan is deprecated.

INT-3152 Polishing Show Skipped Tests as 'Ignored'

In test report.

JIRA: https://jira.springsource.org/browse/INT-3152
This commit is contained in:
Gary Russell
2013-09-27 20:12:11 +03:00
committed by Artem Bilan
parent b81e9255d2
commit bddbc5b6fb
10 changed files with 123 additions and 8 deletions

View File

@@ -0,0 +1,55 @@
/*
* Copyright 2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.test.support;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Assume;
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
/**
* Rule to prevent long running tests from running on every build; set environment
* variable RUN_LONG_INTEGRATION_TESTS on a CI nightly build to ensure coverage.
*
* @author Gary Russell
* @since 3.0
*
*/
public class LongRunningIntegrationTest extends TestWatcher {
private final static Log logger = LogFactory.getLog(LongRunningIntegrationTest.class);
@Override
public Statement apply(Statement base, Description description) {
boolean shouldRun = "true".equalsIgnoreCase(System.getenv("RUN_LONG_INTEGRATION_TESTS"));
if (!shouldRun) {
logger.info("Skipping long running test " + description.getDisplayName());
return new Statement() {
@Override
public void evaluate() throws Throwable {
Assume.assumeTrue(false);
}
};
}
else {
return super.apply(base, description);
}
}
}