diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2021-11-18 15:21:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 15:21:44 +0100 |
commit | 46d1ce434cc7c4149ca9c1ba812888022cfee296 (patch) | |
tree | 5de27b24d6ab5ac9e5d8799361320c75daf97a6d /controller-server | |
parent | 5157613db5dfa2d651363bc56699e9e51b31e9e0 (diff) | |
parent | f91cc57a8e8ff9b76611d5a2323ee6f071210fb9 (diff) |
Merge pull request #20085 from vespa-engine/jonmv/vespa-cli-test-runner
Jonmv/vespa cli test runner
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java | 42 | ||||
-rw-r--r-- | controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java | 12 | ||||
-rw-r--r-- | controller-server/src/test/resources/test_runner_services.xml-cd (renamed from controller-server/src/test/resources/test_runner_services.xml-cd-osgi) | 0 | ||||
-rw-r--r-- | controller-server/src/test/resources/test_runner_services.xml-cd-legacy | 22 |
4 files changed, 21 insertions, 55 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 4fcd6b10efa..94f6cccb3a5 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -848,11 +848,9 @@ public class InternalStepRunner implements StepRunner { ZoneId zone = id.type().zone(controller.system()); boolean useTesterCertificate = useTesterCertificate(id); - boolean useOsgiBasedTestRuntime = testerPlatformVersion(id).isAfter(new Version(7, 247, 11)); byte[] servicesXml = servicesXml( ! controller.system().isPublic(), useTesterCertificate, - useOsgiBasedTestRuntime, testerResourcesFor(zone, spec.requireInstance(id.application().instance())), controller.controllerConfig().steprunner().testerapp()); byte[] testPackage = controller.applications().applicationStore().getTester(id.application().tenant(), id.application().application(), version); @@ -904,9 +902,8 @@ public class InternalStepRunner implements StepRunner { } /** Returns the generated services.xml content for the tester application. */ - static byte[] servicesXml( - boolean systemUsesAthenz, boolean useTesterCertificate, boolean useOsgiBasedTestRuntime, - NodeResources resources, ControllerConfig.Steprunner.Testerapp config) { + static byte[] servicesXml(boolean systemUsesAthenz, boolean useTesterCertificate, + NodeResources resources, ControllerConfig.Steprunner.Testerapp config) { int jdiscMemoryGb = 2; // 2Gb memory for tester application (excessive?). int jdiscMemoryPct = (int) Math.ceil(100 * jdiscMemoryGb / resources.memoryGb()); @@ -920,24 +917,6 @@ public class InternalStepRunner implements StepRunner { String runtimeProviderClass = config.runtimeProviderClass(); String tenantCdBundle = config.tenantCdBundle(); - String extraJUnitComponents = - "\n" + - " <component id=\"" + runtimeProviderClass + "\" bundle=\"" + tenantCdBundle + "\" />\n" + - "\n" + - " <component id=\"com.yahoo.vespa.testrunner.JunitRunner\" bundle=\"vespa-osgi-testrunner\">\n" + - " <config name=\"com.yahoo.vespa.testrunner.junit-test-runner\">\n" + - " <artifactsPath>artifacts</artifactsPath>\n" + - " <useAthenzCredentials>" + systemUsesAthenz + "</useAthenzCredentials>\n" + - " </config>\n" + - " </component>\n" + - "\n" + - " <component id=\"com.yahoo.vespa.testrunner.VespaCliTestRunner\" bundle=\"vespa-osgi-testrunner\">\n" + - " <config name=\"com.yahoo.vespa.testrunner.vespa-cli-test-runner\">\n" + - " <artifactsPath>artifacts</artifactsPath>\n" + - " <useAthenzCredentials>" + systemUsesAthenz + "</useAthenzCredentials>\n" + - " </config>\n" + - " </component>\n"; - String servicesXml = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<services xmlns:deploy='vespa' version='1.0'>\n" + @@ -955,7 +934,22 @@ public class InternalStepRunner implements StepRunner { " <handler id=\"com.yahoo.vespa.testrunner.TestRunnerHandler\" bundle=\"vespa-osgi-testrunner\">\n" + " <binding>http://*/tester/v1/*</binding>\n" + " </handler>\n" + - (useOsgiBasedTestRuntime ? extraJUnitComponents : "") + + "\n" + + " <component id=\"" + runtimeProviderClass + "\" bundle=\"" + tenantCdBundle + "\" />\n" + + "\n" + + " <component id=\"com.yahoo.vespa.testrunner.JunitRunner\" bundle=\"vespa-osgi-testrunner\">\n" + + " <config name=\"com.yahoo.vespa.testrunner.junit-test-runner\">\n" + + " <artifactsPath>artifacts</artifactsPath>\n" + + " <useAthenzCredentials>" + systemUsesAthenz + "</useAthenzCredentials>\n" + + " </config>\n" + + " </component>\n" + + "\n" + + " <component id=\"com.yahoo.vespa.testrunner.VespaCliTestRunner\" bundle=\"vespa-osgi-testrunner\">\n" + + " <config name=\"com.yahoo.vespa.testrunner.vespa-cli-test-runner\">\n" + + " <artifactsPath>artifacts</artifactsPath>\n" + + " <useAthenzCredentials>" + systemUsesAthenz + "</useAthenzCredentials>\n" + + " </config>\n" + + " </component>\n" + "\n" + " <nodes count=\"1\" allocated-memory=\"" + jdiscMemoryPct + "%\">\n" + " " + resourceString + "\n" + diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java index 11086ff7663..5cf554f2c01 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java @@ -521,22 +521,16 @@ public class InternalStepRunnerTest { } @Test - public void generates_correct_services_xml_using_osgi_based_runtime() { - generates_correct_services_xml("test_runner_services.xml-cd-osgi", true); + public void generates_correct_services_xml() { + generates_correct_services_xml("test_runner_services.xml-cd"); } - @Test - public void generates_correct_services_xml_using_legacy_runtime() { - generates_correct_services_xml("test_runner_services.xml-cd-legacy", false); - } - - private void generates_correct_services_xml(String filenameExpectedOutput, boolean useOsgiBasedRuntime) { + private void generates_correct_services_xml(String filenameExpectedOutput) { ControllerConfig.Steprunner.Testerapp config = new ControllerConfig.Steprunner.Testerapp.Builder().build(); assertFile(filenameExpectedOutput, new String(InternalStepRunner.servicesXml( true, false, - useOsgiBasedRuntime, new NodeResources(2, 12, 75, 1, NodeResources.DiskSpeed.fast, NodeResources.StorageType.local), config))); } diff --git a/controller-server/src/test/resources/test_runner_services.xml-cd-osgi b/controller-server/src/test/resources/test_runner_services.xml-cd index 634137e3fb6..634137e3fb6 100644 --- a/controller-server/src/test/resources/test_runner_services.xml-cd-osgi +++ b/controller-server/src/test/resources/test_runner_services.xml-cd diff --git a/controller-server/src/test/resources/test_runner_services.xml-cd-legacy b/controller-server/src/test/resources/test_runner_services.xml-cd-legacy deleted file mode 100644 index c6046479934..00000000000 --- a/controller-server/src/test/resources/test_runner_services.xml-cd-legacy +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version='1.0' encoding='UTF-8'?> -<services xmlns:deploy='vespa' version='1.0'> - <container version='1.0' id='tester'> - - <component id="com.yahoo.vespa.hosted.testrunner.TestRunner" bundle="vespa-testrunner-components"> - <config name="com.yahoo.vespa.hosted.testrunner.test-runner"> - <artifactsPath>artifacts</artifactsPath> - <surefireMemoryMb>5120</surefireMemoryMb> - <useAthenzCredentials>true</useAthenzCredentials> - <useTesterCertificate>false</useTesterCertificate> - </config> - </component> - - <handler id="com.yahoo.vespa.testrunner.TestRunnerHandler" bundle="vespa-osgi-testrunner"> - <binding>http://*/tester/v1/*</binding> - </handler> - - <nodes count="1" allocated-memory="17%"> - <resources vcpu="2.00" memory="12.00Gb" disk="75.00Gb" disk-speed="fast" storage-type="local"/> - </nodes> - </container> -</services> |