Skip to content

Commit

Permalink
DEVPROD-3295 update volume size default (evergreen-ci#2252)
Browse files Browse the repository at this point in the history
  • Loading branch information
ablack12 authored Feb 20, 2024
1 parent 304de82 commit d752503
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Spawn/spawnHostModal/constants.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const DEFAULT_VOLUME_SIZE = 500;
export const DEFAULT_VOLUME_SIZE = 256;
3 changes: 2 additions & 1 deletion src/components/Spawn/spawnHostModal/getFormSchema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from "gql/generated/types";
import { shortenGithash } from "utils/string";
import { getDefaultExpiration } from "../utils";
import { DEFAULT_VOLUME_SIZE } from "./constants";
import { validateTask } from "./utils";
import { DistroDropdown } from "./Widgets/DistroDropdown";

Expand Down Expand Up @@ -408,7 +409,7 @@ export const getFormSchema = ({
volumeSize: {
title: "Volume size (GB)",
type: "number" as "number",
default: 500,
default: DEFAULT_VOLUME_SIZE,
},
},
},
Expand Down
6 changes: 5 additions & 1 deletion src/components/Spawn/spawnVolumeModal/getFormSchema.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { css } from "@emotion/react";
import { add } from "date-fns";
import { DEFAULT_VOLUME_SIZE } from "components/Spawn/spawnHostModal/constants";
import { GetFormSchema } from "components/SpruceForm/types";
import { ExpirationRow } from "../ExpirationRow";
import { getDefaultExpiration } from "../utils";
Expand Down Expand Up @@ -32,7 +33,10 @@ export const getFormSchema = ({
size: {
title: "Size (GiB)",
type: "number" as "number",
default: maxSpawnableLimit > 500 ? 500 : maxSpawnableLimit,
default:
maxSpawnableLimit > DEFAULT_VOLUME_SIZE
? DEFAULT_VOLUME_SIZE
: maxSpawnableLimit,
minimum: 1,
maximum: maxSpawnableLimit,
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/spawn/spawnVolume/SpawnVolumeModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("spawnVolumeModal", () => {
await waitFor(() => {
expect(screen.queryByDataCy("spawn-volume-modal")).toBeVisible();
});
expect(screen.queryByDataCy("volume-size-input")).toHaveValue("500");
expect(screen.queryByDataCy("volume-size-input")).toHaveValue("256");
expect(screen.queryByDataCy("availability-zone-select")).toHaveTextContent(
"us-east-1a",
);
Expand All @@ -77,7 +77,7 @@ describe("spawnVolumeModal", () => {
variables: {
spawnVolumeInput: {
availabilityZone: "us-east-1a",
size: 500,
size: 256,
type: "gp2",
expiration: null,
noExpiration: true,
Expand Down

0 comments on commit d752503

Please sign in to comment.