def test_canary_third(): sdk_cmd.svc_cli(config.PACKAGE_NAME, config.SERVICE_NAME, "plan continue deploy hello-deploy") expected_tasks = ["hello-0", "hello-1", "hello-2", "hello-3", "world-0"] sdk_tasks.check_running(config.SERVICE_NAME, len(expected_tasks)) rc, stdout, _ = sdk_cmd.svc_cli(config.PACKAGE_NAME, config.SERVICE_NAME, "pod list") assert rc == 0, "Pod list failed" assert json.loads(stdout) == expected_tasks pl = sdk_plan.wait_for_completed_phase(config.SERVICE_NAME, "deploy", "hello-deploy") log.info(pl) assert pl["status"] == "WAITING" assert len(pl["phases"]) == 2 phase = pl["phases"][0] assert phase["status"] == "COMPLETE" steps = phase["steps"] assert len(steps) == 4 assert steps[0]["status"] == "COMPLETE" assert steps[1]["status"] == "COMPLETE" assert steps[2]["status"] == "COMPLETE" assert steps[3]["status"] == "COMPLETE" phase = pl["phases"][1] assert phase["status"] == "WAITING" steps = phase["steps"] assert len(steps) == 4 assert steps[0]["status"] == "COMPLETE" assert steps[1]["status"] == "WAITING" assert steps[2]["status"] == "PENDING" assert steps[3]["status"] == "PENDING"
def test_canary_third(): sdk_cmd.run_cli('hello-world plan continue deploy hello-deploy') expected_tasks = ['hello-0', 'hello-1', 'hello-2', 'hello-3', 'world-0'] sdk_tasks.check_running(config.PACKAGE_NAME, len(expected_tasks)) assert json.loads( sdk_cmd.run_cli('hello-world pod list')) == expected_tasks pl = sdk_plan.wait_for_completed_phase(config.PACKAGE_NAME, 'deploy', 'hello-deploy') log.info(pl) assert pl['status'] == 'WAITING' assert len(pl['phases']) == 2 phase = pl['phases'][0] assert phase['status'] == 'COMPLETE' steps = phase['steps'] assert len(steps) == 4 assert steps[0]['status'] == 'COMPLETE' assert steps[1]['status'] == 'COMPLETE' assert steps[2]['status'] == 'COMPLETE' assert steps[3]['status'] == 'COMPLETE' phase = pl['phases'][1] assert phase['status'] == 'WAITING' steps = phase['steps'] assert len(steps) == 4 assert steps[0]['status'] == 'COMPLETE' assert steps[1]['status'] == 'WAITING' assert steps[2]['status'] == 'PENDING' assert steps[3]['status'] == 'PENDING'
def test_canary_third(): sdk_cmd.svc_cli(config.PACKAGE_NAME, config.SERVICE_NAME, 'plan continue deploy hello-deploy') expected_tasks = [ 'hello-0', 'hello-1', 'hello-2', 'hello-3', 'world-0'] sdk_tasks.check_running(config.SERVICE_NAME, len(expected_tasks)) assert sdk_cmd.svc_cli(config.PACKAGE_NAME, config.SERVICE_NAME, 'pod list', json=True) == expected_tasks pl = sdk_plan.wait_for_completed_phase(config.SERVICE_NAME, 'deploy', 'hello-deploy') log.info(pl) assert pl['status'] == 'WAITING' assert len(pl['phases']) == 2 phase = pl['phases'][0] assert phase['status'] == 'COMPLETE' steps = phase['steps'] assert len(steps) == 4 assert steps[0]['status'] == 'COMPLETE' assert steps[1]['status'] == 'COMPLETE' assert steps[2]['status'] == 'COMPLETE' assert steps[3]['status'] == 'COMPLETE' phase = pl['phases'][1] assert phase['status'] == 'WAITING' steps = phase['steps'] assert len(steps) == 4 assert steps[0]['status'] == 'COMPLETE' assert steps[1]['status'] == 'WAITING' assert steps[2]['status'] == 'PENDING' assert steps[3]['status'] == 'PENDING'