diff --git a/src/gql/generated/types.ts b/src/gql/generated/types.ts index 8cdae65f8e..d69f8ee2bb 100644 --- a/src/gql/generated/types.ts +++ b/src/gql/generated/types.ts @@ -2515,6 +2515,7 @@ export type Task = { generateTask?: Maybe; generatedBy?: Maybe; generatedByName?: Maybe; + hasCedarResults: Scalars["Boolean"]["output"]; hostId?: Maybe; id: Scalars["String"]["output"]; ingestTime?: Maybe; @@ -6336,7 +6337,7 @@ export type MainlineCommitsQuery = { __typename?: "Task"; displayName: string; execution: number; - failedTestCount: number; + hasCedarResults: boolean; id: string; status: string; timeTaken?: number | null; diff --git a/src/gql/queries/mainline-commits.graphql b/src/gql/queries/mainline-commits.graphql index 1c7c7609fd..f30ade7ce5 100644 --- a/src/gql/queries/mainline-commits.graphql +++ b/src/gql/queries/mainline-commits.graphql @@ -31,7 +31,7 @@ query MainlineCommits( tasks { displayName execution - failedTestCount + hasCedarResults id status timeTaken diff --git a/src/pages/commits/ActiveCommits/BuildVariantCard/BuildVariantCard.test.tsx b/src/pages/commits/ActiveCommits/BuildVariantCard/BuildVariantCard.test.tsx index f5fe3759ef..c439486a79 100644 --- a/src/pages/commits/ActiveCommits/BuildVariantCard/BuildVariantCard.test.tsx +++ b/src/pages/commits/ActiveCommits/BuildVariantCard/BuildVariantCard.test.tsx @@ -59,15 +59,18 @@ const tasks = [ id: "1", status: "failed", displayName: "One", + hasCedarResults: true, }, { id: "2", status: "success", displayName: "Two", + hasCedarResults: true, }, { id: "3", status: "success", displayName: "Three", + hasCedarResults: true, }, ]; diff --git a/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/WaterfallTaskStatusIcon.stories.tsx b/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/WaterfallTaskStatusIcon.stories.tsx index 0915298a2a..343b14024a 100644 --- a/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/WaterfallTaskStatusIcon.stories.tsx +++ b/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/WaterfallTaskStatusIcon.stories.tsx @@ -26,7 +26,7 @@ export const Default: CustomStoryObj = { taskId: "task-id", identifier: "ubuntu1604", status: "failed", - failedTestCount: 5, + hasCedarResults: true, }, argTypes: { status: { diff --git a/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/WaterfallTaskStatusIcon.test.tsx b/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/WaterfallTaskStatusIcon.test.tsx index bf62f720eb..d6e28d6b3b 100644 --- a/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/WaterfallTaskStatusIcon.test.tsx +++ b/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/WaterfallTaskStatusIcon.test.tsx @@ -27,24 +27,24 @@ const props = { jest.mock("../../utils"); const Content = ({ - failedTestCount = 0, + hasCedarResults = false, status, }: { status: string; - failedTestCount?: number; + hasCedarResults: boolean; }) => ( ); describe("waterfallTaskStatusIcon", () => { it("tooltip should contain task name, duration, list of failing test names and additonal test count", async () => { const user = userEvent.setup(); - render(); + render(); await user.hover(screen.queryByDataCy("waterfall-task-status-icon")); await waitFor(() => { expect( @@ -67,7 +67,7 @@ describe("waterfallTaskStatusIcon", () => { }); it("icon should link to task page", async () => { - render(); + render(); await waitFor(() => { expect( screen.getByDataCy("waterfall-task-status-icon"), @@ -89,7 +89,7 @@ describe("waterfallTaskStatusIcon", () => { ); (removeGlobalHighlightStyle as jest.Mock).mockImplementationOnce(() => {}); - render(); + render(); await user.hover(screen.queryByDataCy("waterfall-task-status-icon")); await waitFor(() => { expect(injectGlobalHighlightStyle).toHaveBeenCalledTimes(1); diff --git a/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/index.tsx b/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/index.tsx index bec6bbd9ff..7a37d7c249 100644 --- a/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/index.tsx +++ b/src/pages/commits/ActiveCommits/BuildVariantCard/WaterfallTaskStatusIcon/index.tsx @@ -28,7 +28,7 @@ interface WaterfallTaskStatusIconProps { displayName: string; timeTaken?: number; identifier: string; - failedTestCount?: number; + hasCedarResults: boolean; } let timeout; @@ -36,7 +36,7 @@ export const WaterfallTaskStatusIcon: React.FC< WaterfallTaskStatusIconProps > = ({ displayName, - failedTestCount, + hasCedarResults, identifier, status, taskId, @@ -60,7 +60,7 @@ export const WaterfallTaskStatusIcon: React.FC< injectGlobalHighlightStyle(identifier); timeout = setTimeout(() => { // Only query failing test names if the task has failed. - if (isFailedTaskStatus(status) && failedTestCount > 0) { + if (isFailedTaskStatus(status) && hasCedarResults) { loadData(); } }, 600); diff --git a/src/pages/commits/ActiveCommits/BuildVariantCard/index.tsx b/src/pages/commits/ActiveCommits/BuildVariantCard/index.tsx index 1767a88896..7359feb73c 100644 --- a/src/pages/commits/ActiveCommits/BuildVariantCard/index.tsx +++ b/src/pages/commits/ActiveCommits/BuildVariantCard/index.tsx @@ -18,7 +18,7 @@ type taskList = { status: string; displayName: string; timeTaken?: number; - failedTestCount?: number; + hasCedarResults: boolean; }[]; interface Props { variant: string; @@ -96,7 +96,7 @@ const RenderTaskIcons: React.FC = ({ tasks, variant }) => onMouseEnter={() => injectGlobalDimStyle()} onMouseLeave={() => removeGlobalDimStyle()} > - {tasks.map(({ displayName, failedTestCount, id, status, timeTaken }) => ( + {tasks.map(({ displayName, hasCedarResults, id, status, timeTaken }) => ( = ({ tasks, variant }) => displayName={displayName} timeTaken={timeTaken} identifier={`${variant}-${displayName}`} - failedTestCount={failedTestCount} + hasCedarResults={hasCedarResults} /> ))} diff --git a/src/pages/commits/ProjectHealth.stories.tsx b/src/pages/commits/ProjectHealth.stories.tsx index a2a58a15f3..b46239f47f 100644 --- a/src/pages/commits/ProjectHealth.stories.tsx +++ b/src/pages/commits/ProjectHealth.stories.tsx @@ -93,7 +93,7 @@ const generateTasks = (count: number) => id: `task_${index}`, status: randomStatus(index), execution: 0, - failedTestCount: 1, + hasCedarResults: true, })); /** diff --git a/src/pages/commits/testData.ts b/src/pages/commits/testData.ts index 5a03e05783..ef90b3005c 100644 --- a/src/pages/commits/testData.ts +++ b/src/pages/commits/testData.ts @@ -12,7 +12,7 @@ const buildVariant1 = { id: "auth", execution: 0, displayName: "auth", - failedTestCount: 0, + hasCedarResults: false, }, ], }; @@ -26,7 +26,7 @@ const buildVariant2 = { id: "benchmarks", execution: 0, displayName: "benchmarks", - failedTestCount: 0, + hasCedarResults: false, }, ], }; @@ -40,7 +40,7 @@ const buildVariant3 = { id: "fuzzer", execution: 0, displayName: "fuzzer", - failedTestCount: 1, + hasCedarResults: true, }, ], };