summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorHarald Musum <musum@yahoo-inc.com>2016-12-08 22:06:11 +0100
committerHarald Musum <musum@yahoo-inc.com>2016-12-08 22:06:11 +0100
commit11618fcb6c5372c29277d2129e9a011b6a099d81 (patch)
tree1e8468e254f1e1b81730f26cbc938ab946f1586e /configserver
parentb8024c275e9d5bab661910d7360f69422d96557b (diff)
Make sure we create new config (with temp dir) for every test
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java
index 1578bacf429..a6ad3aff6a2 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/HostedDeployTest.java
@@ -26,22 +26,13 @@ import static org.junit.Assert.fail;
public class HostedDeployTest {
private static final String dockerRegistry = "foo.com:4443";
private static final String dockerVespaBaseImage = "/vespa/ci";
- private static final ConfigserverConfig config = new ConfigserverConfig(new ConfigserverConfig.Builder()
- .configServerDBDir(Files.createTempDir()
- .getAbsolutePath())
- .dockerRegistry(dockerRegistry)
- .dockerVespaBaseImage(dockerVespaBaseImage)
- .configServerDBDir(Files.createTempDir()
- .getAbsolutePath())
- .hostedVespa(true)
- .multitenant(true));
@Test
public void testRedeploy() throws InterruptedException, IOException {
- DeployTester tester = new DeployTester("src/test/apps/hosted/", config);
+ DeployTester tester = new DeployTester("src/test/apps/hosted/", createConfigserverConfig());
tester.deployApp("myApp");
- Optional<com.yahoo.config.provision.Deployment> deployment = tester.redeployFromLocalActive();
+ Optional<com.yahoo.config.provision.Deployment> deployment = tester.redeployFromLocalActive();
assertTrue(deployment.isPresent());
deployment.get().prepare();
deployment.get().activate();
@@ -54,7 +45,7 @@ public class HostedDeployTest {
List<ModelFactory> modelFactories = new ArrayList<>();
modelFactories.add(DeployTester.createDefaultModelFactory(clock));
modelFactories.add(DeployTester.createFailingModelFactory(Version.fromIntValues(1, 0, 0))); // older than default
- DeployTester tester = new DeployTester("src/test/apps/validationOverride/", modelFactories, config);
+ DeployTester tester = new DeployTester("src/test/apps/validationOverride/", modelFactories, createConfigserverConfig());
tester.deployApp("myApp");
// Redeployment from local active works
@@ -74,7 +65,7 @@ public class HostedDeployTest {
deployment.get().prepare();
deployment.get().activate();
}
-
+
// However, redeployment from the outside fails after this date
{
try {
@@ -91,7 +82,7 @@ public class HostedDeployTest {
@Ignore //WIP
public void testDeployWithDockerImage() throws InterruptedException, IOException {
final String vespaVersion = "6.51.1";
- DeployTester tester = new DeployTester("src/test/apps/hosted/", config);
+ DeployTester tester = new DeployTester("src/test/apps/hosted/", createConfigserverConfig());
ApplicationId applicationId = tester.deployApp("myApp", Optional.of(vespaVersion));
assertProvisionInfo(vespaVersion, tester, applicationId);
@@ -109,4 +100,14 @@ public class HostedDeployTest {
h.membership().get().cluster().dockerImage().get()));
}
+ private static ConfigserverConfig createConfigserverConfig() {
+ return new ConfigserverConfig(new ConfigserverConfig.Builder()
+ .configServerDBDir(Files.createTempDir()
+ .getAbsolutePath())
+ .dockerRegistry(dockerRegistry)
+ .dockerVespaBaseImage(dockerVespaBaseImage)
+ .hostedVespa(true)
+ .multitenant(true));
+ }
+
}