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

Commit

Permalink
Merge branch 'main' of https://github.com/evergreen-ci/spruce into DE…
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad committed Dec 13, 2023
2 parents cdfd60e + 090f47d commit 0618c76
Show file tree
Hide file tree
Showing 9 changed files with 142 additions and 107 deletions.
14 changes: 14 additions & 0 deletions docs/decisions/2023-12-11_cypress_test_isolation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 2023-12-11 Cypress tests run independently by resetting browser and database state

- design: WRITING-14354
- status: accepted
- date: 2023-6-26
- authors: SupaJoon

## Context and Problem Statement

Cypress tests that mutate browser or Evergreen database state affected outcomes of tests that ran after. This prevented parallelzing tests in CI, running a subset, and thoroughly testing UI flows that mutate Evergreen data.

## Decision Outcome

Cypress tests that mutate Evergreen data follow up with a database reset operation before running the next test. Also, DOM state, cookies, localStorage and sessionStorage are reset before each test. This lets tests run reliably in any order or grouping allowing for parallelization of the test suite.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
"@leafygreen-ui/loading-indicator": "2.0.6",
"@leafygreen-ui/menu": "20.0.1",
"@leafygreen-ui/modal": "16.0.1",
"@leafygreen-ui/number-input": "1.0.17",
"@leafygreen-ui/number-input": "1.0.18",
"@leafygreen-ui/pagination": "1.0.12",
"@leafygreen-ui/palette": "4.0.7",
"@leafygreen-ui/popover": "11.0.17",
"@leafygreen-ui/radio-box-group": "12.0.4",
"@leafygreen-ui/radio-box-group": "12.0.16",
"@leafygreen-ui/radio-group": "10.1.1",
"@leafygreen-ui/search-input": "2.0.8",
"@leafygreen-ui/segmented-control": "8.2.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,18 @@ export const getFormSchema = (
mergeQueue: {
type: "string" as "string",
oneOf: [
{
type: "string" as "string",
title: "Evergreen",
enum: [MergeQueue.Evergreen],
description: "Evergreen's commit queue.",
},
{
type: "string" as "string",
title: "GitHub",
enum: [MergeQueue.Github],
description: "GitHub's merge queue.",
},
{
type: "string" as "string",
title: "Evergreen (deprecated)",
enum: [MergeQueue.Evergreen],
description: "Evergreen's commit queue.",
},
],
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import WithToastContext from "test_utils/toast-decorator";
import { CustomMeta, CustomStoryObj } from "test_utils/types";
import CustomCreatedTickets from "./CustomCreatedTickets";

export default {
component: CustomCreatedTickets,
decorators: [(Story: () => JSX.Element) => WithToastContext(Story)],
} satisfies CustomMeta<typeof CustomCreatedTickets>;

export const Default: CustomStoryObj<typeof CustomCreatedTickets> = {
render: (args) => <CustomCreatedTickets {...args} />,
argTypes: {},
args: {
execution: 0,
taskId: "123",
tickets: [
{
confidenceScore: 0.25,
issueKey: "DEVPROD-1",
jiraTicket: {
key: "key",
fields: {
summary: "Issue Summary",
status: {
id: "id",
name: "Done",
},
created: "2020-01-27",
updated: "2023-11-28",
assigneeDisplayName: "sophie.stadler",
assignedTeam: "evg-ui",
},
},
url: "https://spruce.mongodb.com",
},
{
confidenceScore: 0.5,
issueKey: "DEVPROD-2",
jiraTicket: {
key: "key",
fields: {
summary: "Issue Summary",
status: {
id: "id",
name: "In Progress",
},
created: "2020-01-28",
updated: "2023-11-29",
assigneeDisplayName: "mohamed.khelif",
assignedTeam: "evg-ui",
},
},
url: "https://spruce.mongodb.com",
},
],
},
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import styled from "@emotion/styled";
import { size } from "constants/tokens";
import { IssueLink } from "gql/generated/types";
import { AnnotationTicketRow } from "../AnnotationTicketsTable/AnnotationTicketRow";
import { TicketsTitle } from "../BBComponents";
import FileTicketButton from "../FileTicketButton";
import CustomCreatedTicketsTable from "./CustomCreatedTicketsTable";

interface CustomCreatedTicketProps {
taskId: string;
Expand All @@ -19,11 +21,27 @@ const CustomCreatedTickets: React.FC<CustomCreatedTicketProps> = ({
<FileTicketButton taskId={taskId} execution={execution} />
{!!tickets?.length && (
<>
<TicketsTitle>Tickets Created From This Task</TicketsTitle>
<CustomCreatedTicketsTable tickets={tickets} />
<TicketsTitle margin>Tickets Created From This Task</TicketsTitle>
<TicketContainer>
{tickets.map(({ confidenceScore, issueKey, jiraTicket, url }) => (
<AnnotationTicketRow
confidenceScore={confidenceScore}
issueKey={issueKey}
jiraTicket={jiraTicket}
key={issueKey}
url={url}
/>
))}
</TicketContainer>
</>
)}
</>
);

const TicketContainer = styled.div`
display: flex;
flex-direction: column;
gap: ${size.s};
`;

export default CustomCreatedTickets;

This file was deleted.

1 change: 1 addition & 0 deletions src/utils/string/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const msToDuration = (ms: number): string => {
if (seconds > 0) {
return `${seconds}s`;
}
return `${ms}ms`;
};

/**
Expand Down
4 changes: 4 additions & 0 deletions src/utils/string/string.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ describe("msToDuration", () => {
const ms = 25000;
expect(msToDuration(ms)).toBe("25s");
});
it("does not convert milli < 1s", () => {
const ms = 500;
expect(msToDuration(ms)).toBe("500ms");
});
});

describe("sortFunctionDate", () => {
Expand Down
85 changes: 37 additions & 48 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3242,14 +3242,14 @@
"@leafygreen-ui/tokens" "^2.0.0"
polished "^4.2.2"

"@leafygreen-ui/button@^21.0.3", "@leafygreen-ui/button@^21.0.5", "@leafygreen-ui/button@^21.0.9":
version "21.0.9"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/button/-/button-21.0.9.tgz#019ae6139b5a0a795b1f95d6a1f9ae5db24d5329"
integrity sha512-FbAMdF5WRrBxclXQtQS8C2uIyDKx/X30lWyn7dE4ACvZoYzjSuwkjjZ5eoruJED8gpdqNySQHf91epb1+7nKLA==
"@leafygreen-ui/button@^21.0.10", "@leafygreen-ui/button@^21.0.3", "@leafygreen-ui/button@^21.0.5", "@leafygreen-ui/button@^21.0.9":
version "21.0.11"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/button/-/button-21.0.11.tgz#a1cfa56226d9ccdf43945441340013ff02c55fbe"
integrity sha512-NJhllsXO7jAJoAou9kPIk/B8ODYUrGxr4l4TceoAwAM3cW0kZ5kys9KA+0TOmG2AxNKLcElLu+wCg3TbssFk+Q==
dependencies:
"@leafygreen-ui/box" "^3.1.8"
"@leafygreen-ui/emotion" "^4.0.7"
"@leafygreen-ui/lib" "^13.0.0"
"@leafygreen-ui/lib" "^13.1.0"
"@leafygreen-ui/palette" "^4.0.7"
"@leafygreen-ui/ripple" "^1.1.12"
"@leafygreen-ui/tokens" "^2.1.4"
Expand Down Expand Up @@ -3618,10 +3618,10 @@
lodash "^4.17.21"
prop-types "^15.7.2"

"@leafygreen-ui/lib@^13.0.0":
version "13.0.0"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/lib/-/lib-13.0.0.tgz#b2147e6781bbe658954c2dc97c39d1900f252a4d"
integrity sha512-EWVj4mavtVLaRcpQq9ruPM2yLqovgiVyxX9Y5K8XJ07BlZIhkBRsdB15C4ym++uitbaUIPPHNuGrPLT3Ysi9Tw==
"@leafygreen-ui/lib@^13.0.0", "@leafygreen-ui/lib@^13.1.0":
version "13.1.0"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/lib/-/lib-13.1.0.tgz#c594da94916a5dce6a3bf93adf2bcead4ff62e44"
integrity sha512-YDq/IYwhcIWYg8A81Uo2J/a+0VP9Pfbn2heUGfytLY9gYcrpMYL7kClAHwZzg8iS4iOaIexGcaUFu0I3OYFxyA==
dependencies:
"@storybook/csf" "^0.1.0"
lodash "^4.17.21"
Expand Down Expand Up @@ -3675,23 +3675,23 @@
prop-types "^15.8.1"
react-transition-group "^4.4.5"

"@leafygreen-ui/[email protected].17":
version "1.0.17"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/number-input/-/number-input-1.0.17.tgz#e37a36fd7b94be7439d68d4265b7bab91054dc3a"
integrity sha512-tKi/wl/vhW9DjVJfKTMB72VrIR4LDXiA5pu6uDvDTu7IR6oCU5bhphAPgCIYu845S4aPajke3sH7zmngfynEuA==
"@leafygreen-ui/[email protected].18":
version "1.0.18"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/number-input/-/number-input-1.0.18.tgz#9564ffb4f46b81f9fbd389bef0ed9cf112ccb853"
integrity sha512-93Jd8b9it0wp5pgqjYUooAiMJ8MH8TuLkvyfIADJ49l1tgBhfSyPE8/qbGAIAYvxn3Hhc7OgUz8TlUrOWgHWiw==
dependencies:
"@leafygreen-ui/a11y" "^1.4.11"
"@leafygreen-ui/button" "^21.0.9"
"@leafygreen-ui/button" "^21.0.10"
"@leafygreen-ui/emotion" "^4.0.7"
"@leafygreen-ui/hooks" "^8.0.0"
"@leafygreen-ui/icon" "^11.23.0"
"@leafygreen-ui/hooks" "^8.0.1"
"@leafygreen-ui/icon" "^11.25.0"
"@leafygreen-ui/lib" "^13.0.0"
"@leafygreen-ui/palette" "^4.0.7"
"@leafygreen-ui/popover" "^11.1.1"
"@leafygreen-ui/select" "^11.0.1"
"@leafygreen-ui/select" "^11.1.0"
"@leafygreen-ui/tokens" "^2.2.0"
"@leafygreen-ui/tooltip" "^10.1.0"
"@leafygreen-ui/typography" "^18.0.0"
"@leafygreen-ui/tooltip" "^11.0.0"
"@leafygreen-ui/typography" "^18.0.1"
lodash "^4.17.21"

"@leafygreen-ui/[email protected]":
Expand Down Expand Up @@ -3790,15 +3790,16 @@
"@leafygreen-ui/hooks" "^8.0.0"
"@leafygreen-ui/lib" "^13.0.0"

"@leafygreen-ui/[email protected].4":
version "12.0.4"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/radio-box-group/-/radio-box-group-12.0.4.tgz#36fe865d757c466bad7afd5701852ac7c8796a4d"
integrity sha512-iNXXlIP2NK9+CX314cWs54J9L8b04thU8OEDYYuIC32VNJPEBg4Dzx+o11SW/p+L/6nzw5lnGkfVzAisMq1MpQ==
"@leafygreen-ui/[email protected].16":
version "12.0.16"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/radio-box-group/-/radio-box-group-12.0.16.tgz#866ad9c82998bf85970201c543aec9ea2073b195"
integrity sha512-3jTprIrHO87oUsZCGn+FNkK7/clER+yTLV9GKt13rYlpy429hRs1c9EwNHfhT50DPhENhIIc/XYNMpWTDuWyBg==
dependencies:
"@leafygreen-ui/emotion" "^4.0.3"
"@leafygreen-ui/hooks" "^7.3.3"
"@leafygreen-ui/palette" "^4.0.0"
"@leafygreen-ui/tokens" "^2.0.1"
"@leafygreen-ui/emotion" "^4.0.7"
"@leafygreen-ui/hooks" "^8.0.0"
"@leafygreen-ui/lib" "^13.0.0"
"@leafygreen-ui/palette" "^4.0.7"
"@leafygreen-ui/tokens" "^2.2.0"

"@leafygreen-ui/[email protected]":
version "10.1.1"
Expand Down Expand Up @@ -3900,21 +3901,21 @@
polished "^4.1.3"
react-is "^17.0.1"

"@leafygreen-ui/select@^11.0.1":
version "11.0.1"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/select/-/select-11.0.1.tgz#1c977acd352c675a2e15a30460d6715d8e3394c6"
integrity sha512-MgdRZy2+p997byE1SB5fYU2Tq3dcdH7/DGUEAOLRY0HC3CFZkXlKCq38i8ioOJOir94S9on7mwDLRq2ufMn/Ow==
"@leafygreen-ui/select@^11.1.0":
version "11.1.1"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/select/-/select-11.1.1.tgz#b4d03071837feca1d5c206b36a1018b7d936f43f"
integrity sha512-aH0RNrIF3EU+5ChHJxVVjzlmFGkYRTq9DTRqm9eWgWcZIT3+ggIJCOwBNMr/8rD72NhyXm+RD8Gp2wwk8XJJrg==
dependencies:
"@leafygreen-ui/button" "^21.0.9"
"@leafygreen-ui/button" "^21.0.10"
"@leafygreen-ui/emotion" "^4.0.7"
"@leafygreen-ui/hooks" "^8.0.0"
"@leafygreen-ui/icon" "^11.23.0"
"@leafygreen-ui/hooks" "^8.0.1"
"@leafygreen-ui/icon" "^11.25.0"
"@leafygreen-ui/input-option" "^1.0.13"
"@leafygreen-ui/lib" "^13.0.0"
"@leafygreen-ui/palette" "^4.0.7"
"@leafygreen-ui/popover" "^11.1.1"
"@leafygreen-ui/tokens" "^2.2.0"
"@leafygreen-ui/typography" "^18.0.0"
"@leafygreen-ui/typography" "^18.0.1"
"@types/react-is" "^18.0.0"
lodash "^4.17.21"
polished "^4.1.3"
Expand Down Expand Up @@ -4161,19 +4162,7 @@
"@leafygreen-ui/polymorphic" "^1.3.5"
"@leafygreen-ui/tokens" "^2.1.4"

"@leafygreen-ui/typography@^18.0.0":
version "18.0.0"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/typography/-/typography-18.0.0.tgz#8a6587ecb554c9ecf6e4db6a4a08d953df74222f"
integrity sha512-PzChUF5nhW+peFgt95B3FQqCphxcCoRbuIUlmmYtXBli+J/JF9Tl22XHP6Qewog0Mpc5FXy8uv4mmG3yQ6ZcjA==
dependencies:
"@leafygreen-ui/emotion" "^4.0.7"
"@leafygreen-ui/icon" "^11.22.2"
"@leafygreen-ui/lib" "^13.0.0"
"@leafygreen-ui/palette" "^4.0.7"
"@leafygreen-ui/polymorphic" "^1.3.6"
"@leafygreen-ui/tokens" "^2.1.4"

"@leafygreen-ui/typography@^18.0.1":
"@leafygreen-ui/typography@^18.0.0", "@leafygreen-ui/typography@^18.0.1":
version "18.0.1"
resolved "https://registry.yarnpkg.com/@leafygreen-ui/typography/-/typography-18.0.1.tgz#ca1a05f1e0d2defc9b50838d7ebe64e42c1f2345"
integrity sha512-XPTya1YVmpiGInxrD//aF0uCvhpnGPKDTkkZKD0Mk+bPP3qXaXtP8YwdrGnMLEJsuRG3ipmOrA5/YXcNQDeQkQ==
Expand Down

0 comments on commit 0618c76

Please sign in to comment.