-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEVPROD-5469 Update job logs page to support resmoke logs not hosted …
…in logkeeper (#22)
- Loading branch information
Showing
31 changed files
with
755 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,57 @@ | ||
const buildId = "7e208050e166b1a9025c817b67eee48d"; | ||
const invalidBuildId = "9b07c7f9677e49ddae4c53076ca4f4ca"; | ||
|
||
describe("Job logs page", () => { | ||
beforeEach(() => { | ||
cy.visit(`job-logs/${buildId}`); | ||
}); | ||
|
||
it("renders a table with test links", () => { | ||
cy.dataCy("job-logs-table-row").should("have.length", 105); | ||
const buildId = "7e208050e166b1a9025c817b67eee48d"; | ||
const invalidBuildId = "9b07c7f9677e49ddae4c53076ca4f4ca"; | ||
const taskIdWithResmokeLogs = | ||
"mongodb_mongo_master_enterprise_amazon_linux2_arm64_all_feature_flags_jsCore_patch_9801cf147ed208ce4c0ff8dff4a97cdb216f4c22_65f06bd09ccd4eaaccca1391_24_03_12_14_51_29"; | ||
|
||
// Sort is not enabled | ||
cy.get("th") | ||
.should("have.length", 1) | ||
.then((th) => { | ||
cy.wrap(th).should("not.have.attr", "aria-sort"); | ||
}); | ||
describe("Logkeeper job logs page", () => { | ||
beforeEach(() => { | ||
cy.visit(`job-logs/${buildId}`); | ||
}); | ||
|
||
cy.dataCy("complete-test-logs-link") | ||
.should("have.attr", "href") | ||
.then((href) => { | ||
cy.wrap(href).should( | ||
"contain", | ||
"/resmoke/7e208050e166b1a9025c817b67eee48d/all", | ||
); | ||
}); | ||
}); | ||
}); | ||
it("renders a table with test links", () => { | ||
cy.dataCy("leafygreen-table-row").should("have.length", 105); | ||
|
||
describe("Invalid job logs page", () => { | ||
beforeEach(() => { | ||
cy.visit(`job-logs/${invalidBuildId}`); | ||
cy.dataCy("complete-test-logs-link") | ||
.should("have.attr", "href") | ||
.then((href) => { | ||
cy.wrap(href).should( | ||
"contain", | ||
"/resmoke/7e208050e166b1a9025c817b67eee48d/all", | ||
); | ||
}); | ||
}); | ||
it("visiting an invalid job logs page shows an error toast", () => { | ||
cy.visit(`job-logs/${invalidBuildId}`); | ||
cy.validateToast( | ||
"error", | ||
"There was an error retrieving logs for this build: Logkeeper returned HTTP status 404", | ||
); | ||
}); | ||
}); | ||
describe("Evergreen job logs page", () => { | ||
beforeEach(() => { | ||
cy.visit(`job-logs/${taskIdWithResmokeLogs}/0/job0`); | ||
}); | ||
it("renders a table with test links", () => { | ||
cy.dataCy("leafygreen-table-row").should("have.length", 655); | ||
|
||
it("shows an error toast", () => { | ||
cy.validateToast( | ||
"error", | ||
"There was an error retrieving logs for this build: Logkeeper returned HTTP status 404", | ||
); | ||
// ALl logs link does not work and will be completed in https://jira.mongodb.org/browse/DEVPROD-5949 | ||
// cy.dataCy("complete-test-logs-link") | ||
// .should("have.attr", "href") | ||
// .then((href) => { | ||
// cy.wrap(href).should( | ||
// "contain", | ||
// "/resmoke/7e208050e166b1a9025c817b67eee48d/all", | ||
// ); | ||
// }); | ||
}); | ||
it("visiting an invalid job logs page shows an error toast", () => { | ||
cy.visit(`job-logs/DNE/0/job0`); | ||
cy.validateToast( | ||
"error", | ||
"There was an error retrieving logs for this task: task not found", | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
apps/spruce/src/components/PageTitle/PageTitle.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Badge from "@leafygreen-ui/badge"; | ||
import { CustomMeta, CustomStoryObj } from "test_utils/types"; | ||
import PageTitle from "."; | ||
|
||
export default { | ||
component: PageTitle, | ||
} satisfies CustomMeta<typeof PageTitle>; | ||
|
||
export const Default: CustomStoryObj<typeof PageTitle> = { | ||
render: (args) => <PageTitle {...args} />, | ||
argTypes: {}, | ||
args: { | ||
loading: false, | ||
title: "Test Page", | ||
size: "large", | ||
badge: <Badge>Some Badge</Badge>, | ||
}, | ||
}; | ||
|
||
export const WithBadge: CustomStoryObj<typeof PageTitle> = { | ||
render: (args) => <PageTitle {...args} />, | ||
argTypes: {}, | ||
args: { | ||
loading: false, | ||
title: "Test Page", | ||
badge: <Badge>Some Badge</Badge>, | ||
}, | ||
}; | ||
|
||
export const WithSubtitle: CustomStoryObj<typeof PageTitle> = { | ||
render: (args) => <PageTitle {...args} />, | ||
argTypes: {}, | ||
args: { | ||
loading: false, | ||
title: "Test Page", | ||
subtitle: <>Some subtitle</>, | ||
}, | ||
}; |
101 changes: 101 additions & 0 deletions
101
apps/spruce/src/components/PageTitle/__snapshots__/PageTitle.stories.storyshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Snapshot Tests PageTitle.stories Default 1`] = ` | ||
<div> | ||
<div | ||
class="css-1ogcarq-Container exz365g3" | ||
> | ||
<div | ||
class="css-1pr1jy2-PageHeader exz365g1" | ||
> | ||
<span | ||
class="css-1up2o4-TitleWrapper exz365g0" | ||
> | ||
<h2 | ||
class="leafygreen-ui-oaqrgz" | ||
> | ||
<span | ||
data-cy="page-title" | ||
> | ||
Test Page | ||
</span> | ||
<div | ||
class="css-2i76u1-BadgeWrapper exz365g2" | ||
> | ||
<div | ||
class="leafygreen-ui-ohl2hc" | ||
> | ||
Some Badge | ||
</div> | ||
</div> | ||
</h2> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`Snapshot Tests PageTitle.stories WithBadge 1`] = ` | ||
<div> | ||
<div | ||
class="css-1mjm61p-Container exz365g3" | ||
> | ||
<div | ||
class="css-z0zdsn-PageHeader exz365g1" | ||
> | ||
<span | ||
class="css-6bgihq-TitleWrapper exz365g0" | ||
> | ||
<h6 | ||
class="leafygreen-ui-19p3n10" | ||
> | ||
<span | ||
data-cy="page-title" | ||
> | ||
Test Page | ||
</span> | ||
<div | ||
class="css-yrksc4-BadgeWrapper exz365g2" | ||
> | ||
<div | ||
class="leafygreen-ui-ohl2hc" | ||
> | ||
Some Badge | ||
</div> | ||
</div> | ||
</h6> | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`Snapshot Tests PageTitle.stories WithSubtitle 1`] = ` | ||
<div> | ||
<div | ||
class="css-1mjm61p-Container exz365g3" | ||
> | ||
<div | ||
class="css-z0zdsn-PageHeader exz365g1" | ||
> | ||
<span | ||
class="css-6bgihq-TitleWrapper exz365g0" | ||
> | ||
<h6 | ||
class="leafygreen-ui-19p3n10" | ||
> | ||
<span | ||
data-cy="page-title" | ||
> | ||
Test Page | ||
</span> | ||
<div | ||
class="css-yrksc4-BadgeWrapper exz365g2" | ||
/> | ||
</h6> | ||
</span> | ||
</div> | ||
Some subtitle | ||
</div> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.