Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
DEVPROD-3397: Add host creation error to Host Events table (#2231)
Browse files Browse the repository at this point in the history
  • Loading branch information
SupaJoon authored Jan 22, 2024
1 parent 6294c7a commit 3bf43f9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cypress/integration/host/host_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ describe("Host events", () => {
text: "Host modify attempt failed",
logsTitle: "Additional details",
},
{
hostType: "host-creation-failed",
text: "Host creation failed.",
logsTitle: "Host creation logs",
},
];
cy.visit(pathWithEvents);
clickOnPageSizeBtnAndAssertURLandTableSize(100, dataCyTableRows);
Expand All @@ -179,6 +184,7 @@ describe("Host events", () => {

it("host events logs do not display when not available", () => {
cy.visit(pathWithEvents);
clickOnPageSizeBtnAndAssertURLandTableSize(100, dataCyTableRows);
cy.dataCy("host-status-changed")
.contains("Status changed from running to stopping")
.first()
Expand Down
9 changes: 9 additions & 0 deletions src/pages/host/HostEventString.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ export const HostEventString: React.FC<HostEventStringProps> = ({
)}
</span>
);
case HostEvent.HostCreatedError:
return (
<span data-cy="host-creation-failed">
Host creation failed.
{data.logs && (
<HostEventLog title="Host creation logs" logs={data.logs} isCode />
)}
</span>
);
default:
return <span>{eventType}</span>;
}
Expand Down
1 change: 1 addition & 0 deletions src/types/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export enum UpdateHostStatus {

export enum HostEvent {
Created = "HOST_CREATED",
HostCreatedError = "HOST_CREATED_ERROR",
AgentDeployFailed = "HOST_AGENT_DEPLOY_FAILED",
ProvisionError = "HOST_PROVISION_ERROR",
Started = "HOST_STARTED",
Expand Down

0 comments on commit 3bf43f9

Please sign in to comment.