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

DEVPROD-3397: Add host creation error to Host Events table #2231

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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