From b0a2c946c3ad8443c8be93158ab182d1b51f9237 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Tue, 4 Aug 2020 10:05:57 +0200 Subject: Remove support for search definitions in docproc bundles --- .../src/test/apps/zkfeed/components/defs-only.jar | Bin 988 -> 0 bytes .../config/server/deploy/ZooKeeperClientTest.java | 39 ++------------------- 2 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 configserver/src/test/apps/zkfeed/components/defs-only.jar (limited to 'configserver') diff --git a/configserver/src/test/apps/zkfeed/components/defs-only.jar b/configserver/src/test/apps/zkfeed/components/defs-only.jar deleted file mode 100644 index 28f563cd779..00000000000 Binary files a/configserver/src/test/apps/zkfeed/components/defs-only.jar and /dev/null differ diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClientTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClientTest.java index a4fce5e37ba..5105f1b0d5f 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClientTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClientTest.java @@ -18,7 +18,6 @@ import com.yahoo.vespa.config.server.zookeeper.ConfigCurator; import com.yahoo.vespa.config.server.zookeeper.ZKApplicationPackage; import com.yahoo.vespa.curator.mock.MockCurator; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -100,38 +99,18 @@ public class ZooKeeperClientTest { String defsPath = appPath + ConfigCurator.DEFCONFIGS_ZK_SUBPATH; assertTrue(zk.exists(appPath, ConfigCurator.DEFCONFIGS_ZK_SUBPATH.replaceFirst("/", ""))); List children = zk.getChildren(defsPath); - assertEquals(defsPath + " children", 2, children.size()); + assertEquals(defsPath + " children", 1, children.size()); Collections.sort(children); assertThat(children.get(0), is("a.b.test2")); assertTrue(zk.exists(appPath, ConfigCurator.USER_DEFCONFIGS_ZK_SUBPATH.replaceFirst("/", ""))); String userDefsPath = appPath + ConfigCurator.USER_DEFCONFIGS_ZK_SUBPATH; children = zk.getChildren(userDefsPath); - assertThat(children.size(), is(2)); + assertThat(children.size(), is(1)); Collections.sort(children); assertThat(children.get(0), is("a.b.test2")); } - // TODO: Evaluate if we want this or not - @Test - @Ignore - public void testFeedComponentsFileReferencesToZooKeeper() { - final String appDir = "src/test/apps/app_sdbundles"; - ConfigCurator zk = ConfigCurator.create(new MockCurator()); - BaseDeployLogger logger = new BaseDeployLogger(); - Path app = Path.fromString("/1"); - ZooKeeperClient zooKeeperClient = new ZooKeeperClient(zk, logger, app); - zooKeeperClient.setupZooKeeper(); - - String currentAppPath = app.getAbsolute(); - assertTrue(zk.exists(currentAppPath, ConfigCurator.USERAPP_ZK_SUBPATH.replaceFirst("/", ""))); - assertTrue(zk.exists(currentAppPath + ConfigCurator.USERAPP_ZK_SUBPATH, "components")); - assertTrue(zk.exists(currentAppPath + ConfigCurator.USERAPP_ZK_SUBPATH + "/components", "testbundle.jar")); - assertTrue(zk.exists(currentAppPath + ConfigCurator.USERAPP_ZK_SUBPATH + "/components", "testbundle2.jar")); - String data = zk.getData(currentAppPath + ConfigCurator.USERAPP_ZK_SUBPATH + "/components", "testbundle2.jar"); - assertThat(data, is(new File(appDir + "/components/testbundle2.jar").getAbsolutePath())); - } - @Test public void testFeedAppMetaDataToZooKeeper() { assertTrue(zk.exists(appPath, ConfigCurator.META_ZK_PATH)); @@ -168,20 +147,6 @@ public class ZooKeeperClientTest { assertTrue(zk.exists(appPath().append("search").append("chains").append("dir2").append("chain3.xml").getAbsolute())); } - @Test - public void search_definitions_written_to_ZK() { - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("music.sd").getAbsolute())); - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("base.sd").getAbsolute())); - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("video.sd").getAbsolute())); - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("book.sd").getAbsolute())); - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("pc.sd").getAbsolute())); - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("laptop.sd").getAbsolute())); - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("product.sd").getAbsolute())); - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("sock.sd").getAbsolute())); - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("foo.expression").getAbsolute())); - assertTrue(zk.exists(appPath().append(ApplicationPackage.SEARCH_DEFINITIONS_DIR).append("bar.expression").getAbsolute())); - } - private Path appPath() { return Path.fromString(appPath).append(ConfigCurator.USERAPP_ZK_SUBPATH); } -- cgit v1.2.3