def when_promote_to_run(_context): try: pl.promoteBuild() | should.be_true.desc( "Build is promoted to Run stage.") except AssertionError as e: helpers.gather_pod_logs(_context, "jenkins") raise e
def then_running_state(_context): try: pl.buildStatus(30, 30, 'Running') | should.be_true.desc( "Build failed to get to Running state.") except AssertionError as e: helpers.gather_pod_logs(_context, "jenkins") raise e
def then_new_state(_context): try: pl.buildStatus(30, 5, 'New') | should.be_true.desc("Build is in New state") except AssertionError as e: helpers.gather_pod_logs(_context, "jenkins") raise e
def then_build_completed(_context): try: pl.buildStatus(30, 10, 'Complete') | should.be_true.desc("Build is complete.") pipeline.pipelineVerified = True except AssertionError as e: helpers.gather_pod_logs(_context, "jenkins") raise e
def then_workspace_created(_context): workspaceID = helpers.getWorkspaceID() try: workspaceID | should_not.be_none().desc( "Workspace is created. Workspace ID is set.") except AssertionError as e: helpers.gather_pod_logs(_context, "che") raise e
def given_ready_promoted(_context): try: pl.buildStatus( 30, 30, ['Running', 'Complete'], 'openshift.io/jenkins-pending-input-actions-json' ) | should.be_true.desc("Build is ready to be promoted.") except AssertionError as e: helpers.gather_pod_logs(_context, "jenkins") raise e
def then_workspace_deleted(_context): workspaceID = helpers.getWorkspaceID() workspace = Workspace() workspace.workspaceDelete(workspaceID) workspaceDeleteStatus = workspace.workspaceDeleteStatus(workspaceID) try: workspaceDeleteStatus | should.be_true().desc("Workspace was deleted.") except AssertionError as e: helpers.gather_pod_logs(_context, "che") raise e
def then_workspace_stopped(_context): workspaceID = helpers.getWorkspaceID() workspace = Workspace() workspace.workspaceStop(workspaceID) workspaceStatus = workspace.workspaceStatus(workspaceID, 10, "STOPPED") try: workspaceStatus | should.be_true().desc("Workspace is stopped.") except AssertionError as e: helpers.gather_pod_logs(_context, "che") raise e
def then_workspace_started(_context): workspaceID = helpers.getWorkspaceID() workspace = Workspace() workspaceStatus = workspace.workspaceStatus(workspaceID, 20, "RUNNING") try: workspaceStatus | should.be_true().desc( "Workspace is started and running.") except AssertionError as e: helpers.gather_pod_logs(_context, "che") raise e