Skip to content

Commit

Permalink
Adding deprovision/delete to reprovision failure tests
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Palis <[email protected]>
  • Loading branch information
joshpalis committed Aug 13, 2024
1 parent 0c0dae1 commit 6e5656e
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,23 @@ public void testReprovisionWithNoChange() throws Exception {
ResponseException exception = expectThrows(ResponseException.class, () -> reprovisionWorkflow(client(), workflowId, template));
assertEquals(RestStatus.BAD_REQUEST.getStatus(), exception.getResponse().getStatusLine().getStatusCode());
assertTrue(exception.getMessage().contains("Template does not contain any modifications"));

// Deprovision and delete all resources
Response deprovisionResponse = deprovisionWorkflowWithAllowDelete(
client(),
workflowId,
"nlp-ingest-pipeline" + "," + "my-nlp-index"
);
assertBusy(
() -> { getAndAssertWorkflowStatus(client(), workflowId, State.NOT_STARTED, ProvisioningProgress.NOT_STARTED); },
60,
TimeUnit.SECONDS
);
assertEquals(RestStatus.OK, TestHelpers.restStatus(deprovisionResponse));

// Hit Delete API
Response deleteResponse = deleteWorkflow(client(), workflowId);
assertEquals(RestStatus.OK, TestHelpers.restStatus(deleteResponse));
}

public void testReprovisionWithDeletion() throws Exception {
Expand Down Expand Up @@ -596,6 +613,23 @@ public void testReprovisionWithDeletion() throws Exception {
);
assertEquals(RestStatus.BAD_REQUEST.getStatus(), exception.getResponse().getStatusLine().getStatusCode());
assertTrue(exception.getMessage().contains("Workflow Step deletion is not supported when reprovisioning a template."));

// Deprovision and delete all resources
Response deprovisionResponse = deprovisionWorkflowWithAllowDelete(
client(),
workflowId,
"nlp-ingest-pipeline" + "," + "my-nlp-index"
);
assertBusy(
() -> { getAndAssertWorkflowStatus(client(), workflowId, State.NOT_STARTED, ProvisioningProgress.NOT_STARTED); },
60,
TimeUnit.SECONDS
);
assertEquals(RestStatus.OK, TestHelpers.restStatus(deprovisionResponse));

// Hit Delete API
Response deleteResponse = deleteWorkflow(client(), workflowId);
assertEquals(RestStatus.OK, TestHelpers.restStatus(deleteResponse));
}

public void testTimestamps() throws Exception {
Expand Down

0 comments on commit 6e5656e

Please sign in to comment.