Search in sources :

Example 71 with Application

use of com.yahoo.vespa.hosted.controller.Application in project vespa by vespa-engine.

the class RotationTest method out_of_rotations.

@Test
public void out_of_rotations() {
    // Assigns 1 rotation
    tester.deployCompletely(application, applicationPackage);
    // Assigns 1 more
    Application application2 = tester.createApplication("app2", "tenant2", 22L, 2L);
    tester.deployCompletely(application2, applicationPackage);
    // We're now out of rotations
    thrown.expect(IllegalStateException.class);
    thrown.expectMessage("no rotations available");
    Application application3 = tester.createApplication("app3", "tenant3", 33L, 3L);
    tester.deployCompletely(application3, applicationPackage);
}
Also used : Application(com.yahoo.vespa.hosted.controller.Application) Test(org.junit.Test)

Example 72 with Application

use of com.yahoo.vespa.hosted.controller.Application in project vespa by vespa-engine.

the class RotationTest method application_with_corp_region_and_two_non_corp_region.

@Test
public void application_with_corp_region_and_two_non_corp_region() {
    ApplicationPackage applicationPackage = new ApplicationPackageBuilder().globalServiceId("foo").region("us-east-3").region("corp-us-east-1").region("us-west-1").build();
    Application application = tester.createApplication("app2", "tenant2", 22L, 2L);
    tester.deployCompletely(application, applicationPackage);
    assertEquals(new RotationId("foo-1"), tester.applications().require(application.id()).rotation().get().id());
}
Also used : ApplicationPackageBuilder(com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder) ApplicationPackage(com.yahoo.vespa.hosted.controller.application.ApplicationPackage) Application(com.yahoo.vespa.hosted.controller.Application) Test(org.junit.Test)

Example 73 with Application

use of com.yahoo.vespa.hosted.controller.Application in project vespa by vespa-engine.

the class RotationTest method too_few_zones.

@Test
public void too_few_zones() {
    ApplicationPackage applicationPackage = new ApplicationPackageBuilder().globalServiceId("foo").region("us-east-3").build();
    Application application = tester.createApplication("app2", "tenant2", 22L, 2L);
    thrown.expect(RuntimeException.class);
    thrown.expectMessage("less than 2 prod zones are defined");
    tester.deployCompletely(application, applicationPackage);
}
Also used : ApplicationPackageBuilder(com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder) ApplicationPackage(com.yahoo.vespa.hosted.controller.application.ApplicationPackage) Application(com.yahoo.vespa.hosted.controller.Application) Test(org.junit.Test)

Example 74 with Application

use of com.yahoo.vespa.hosted.controller.Application in project vespa by vespa-engine.

the class VersionStatusTest method testVersionStatusAfterApplicationUpdates.

@Test
public void testVersionStatusAfterApplicationUpdates() {
    DeploymentTester tester = new DeploymentTester();
    ApplicationPackage applicationPackage = new ApplicationPackageBuilder().upgradePolicy("default").environment(Environment.prod).region("us-west-1").region("us-east-3").build();
    Version version1 = new Version("5.1");
    Version version2 = new Version("5.2");
    tester.upgradeSystem(version1);
    // Setup applications
    Application app1 = tester.createAndDeploy("app1", 11, applicationPackage);
    Application app2 = tester.createAndDeploy("app2", 22, applicationPackage);
    Application app3 = tester.createAndDeploy("app3", 33, applicationPackage);
    // version2 is released
    tester.upgradeSystem(version2);
    // - app1 is in production on version1, but then fails in system test on version2
    tester.completeUpgradeWithError(app1, version2, applicationPackage, systemTest);
    // - app2 is partially in production on version1 and partially on version2
    tester.completeUpgradeWithError(app2, version2, applicationPackage, productionUsEast3);
    // - app3 is in production on version1, but then fails in staging test on version2
    tester.completeUpgradeWithError(app3, version2, applicationPackage, stagingTest);
    tester.updateVersionStatus();
    List<VespaVersion> versions = tester.controller().versionStatus().versions();
    assertEquals("The two versions above exist", 2, versions.size());
    System.err.println(tester.controller().applications().deploymentTrigger().jobTimeoutLimit());
    VespaVersion v1 = versions.get(0);
    assertEquals(version1, v1.versionNumber());
    assertEquals("No applications are failing on version1.", ImmutableSet.of(), v1.statistics().failing());
    assertEquals("All applications have at least one active production deployment on version 1.", ImmutableSet.of(app1.id(), app2.id(), app3.id()), v1.statistics().production());
    assertEquals("No applications have active deployment jobs on version1.", ImmutableSet.of(), v1.statistics().deploying());
    VespaVersion v2 = versions.get(1);
    assertEquals(version2, v2.versionNumber());
    assertEquals("All applications have failed on version2 in at least one zone.", ImmutableSet.of(app1.id(), app2.id(), app3.id()), v2.statistics().failing());
    assertEquals("Only app2 has successfully deployed to production on version2.", ImmutableSet.of(app2.id()), v2.statistics().production());
// Should test the below, but can't easily be done with current test framework. This test passes in DeploymentApiTest.
// assertEquals("All applications are being retried on version2.", ImmutableSet.of(app1.id(), app2.id(), app3.id()), v2.statistics().deploying());
}
Also used : Version(com.yahoo.component.Version) DeploymentTester(com.yahoo.vespa.hosted.controller.deployment.DeploymentTester) ApplicationPackageBuilder(com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder) ApplicationPackage(com.yahoo.vespa.hosted.controller.application.ApplicationPackage) Application(com.yahoo.vespa.hosted.controller.Application) Test(org.junit.Test) JobType.systemTest(com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobType.systemTest) JobType.stagingTest(com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobType.stagingTest)

Example 75 with Application

use of com.yahoo.vespa.hosted.controller.Application in project vespa by vespa-engine.

the class VersionStatusTest method testConfidenceOverride.

@Test
public void testConfidenceOverride() {
    DeploymentTester tester = new DeploymentTester();
    Version version0 = new Version("5.0");
    tester.upgradeSystem(version0);
    // Create and deploy application on current version
    Application app = tester.createAndDeploy("app", 1, "canary");
    tester.updateVersionStatus();
    assertEquals(Confidence.high, confidence(tester.controller(), version0));
    // Override confidence
    tester.upgrader().overrideConfidence(version0, Confidence.broken);
    tester.updateVersionStatus();
    assertEquals(Confidence.broken, confidence(tester.controller(), version0));
    // New version is released and application upgrades
    Version version1 = new Version("5.1");
    tester.upgradeSystem(version1);
    tester.completeUpgrade(app, version1, "canary");
    tester.updateVersionStatus();
    assertEquals(Confidence.high, confidence(tester.controller(), version1));
    // Stale override was removed
    assertFalse("Stale override removed", tester.controller().curator().readConfidenceOverrides().keySet().contains(version0));
}
Also used : Version(com.yahoo.component.Version) DeploymentTester(com.yahoo.vespa.hosted.controller.deployment.DeploymentTester) Application(com.yahoo.vespa.hosted.controller.Application) Test(org.junit.Test) JobType.systemTest(com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobType.systemTest) JobType.stagingTest(com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobType.stagingTest)

Aggregations

Application (com.yahoo.vespa.hosted.controller.Application)75 Test (org.junit.Test)52 ApplicationPackage (com.yahoo.vespa.hosted.controller.application.ApplicationPackage)40 JobType.systemTest (com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobType.systemTest)34 Version (com.yahoo.component.Version)32 JobType.stagingTest (com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobType.stagingTest)28 ApplicationPackageBuilder (com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder)26 DeploymentTester (com.yahoo.vespa.hosted.controller.deployment.DeploymentTester)25 Deployment (com.yahoo.vespa.hosted.controller.application.Deployment)15 VespaVersion (com.yahoo.vespa.hosted.controller.versions.VespaVersion)14 ApplicationId (com.yahoo.config.provision.ApplicationId)13 LockedApplication (com.yahoo.vespa.hosted.controller.LockedApplication)12 Slime (com.yahoo.slime.Slime)11 ControllerTester (com.yahoo.vespa.hosted.controller.ControllerTester)9 TenantId (com.yahoo.vespa.hosted.controller.api.identifiers.TenantId)8 ZoneId (com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId)8 ApplicationVersion (com.yahoo.vespa.hosted.controller.application.ApplicationVersion)8 SlimeJsonResponse (com.yahoo.vespa.hosted.controller.restapi.SlimeJsonResponse)7 Cursor (com.yahoo.slime.Cursor)6 Controller (com.yahoo.vespa.hosted.controller.Controller)6