Specify optional tests with an environment variable.

This commit is contained in:
akwizgran
2018-09-06 10:34:04 +01:00
parent e12601dd08
commit b2febbc6e9
10 changed files with 20 additions and 34 deletions

View File

@@ -40,7 +40,5 @@ project.afterEvaluate {
}
tasks.withType(Test) {
// Use entropy-gathering device specified on command line, if any
systemProperty 'java.security.egd', System.getProperty('java.security.egd')
systemProperty 'java.library.path', 'libs'
}

View File

@@ -12,7 +12,6 @@ import org.briarproject.bramble.test.BrambleTestCase;
import org.briarproject.bramble.test.DaggerBrambleJavaIntegrationTestComponent;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.io.File;
@@ -28,11 +27,12 @@ import static java.util.Collections.singletonList;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.briarproject.bramble.test.TestUtils.deleteTestDirectory;
import static org.briarproject.bramble.test.TestUtils.getTestDirectory;
import static org.briarproject.bramble.test.TestUtils.isOptionalTestEnabled;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
@Ignore("Might fail non-deterministically when bridges are down")
public class BridgeTest extends BrambleTestCase {
private final static long TIMEOUT = SECONDS.toMillis(23);
@@ -61,6 +61,9 @@ public class BridgeTest extends BrambleTestCase {
@Before
public void setUp() {
// Skip this test unless it's explicitly enabled in the environment
assumeTrue(isOptionalTestEnabled(BridgeTest.class));
BrambleJavaIntegrationTestComponent component =
DaggerBrambleJavaIntegrationTestComponent.builder().build();
component.inject(this);