Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions .changeset/tender-cups-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": patch
---

Remove --json flag from containers and cloudchamber commands (except for "curl" and "images list")
68 changes: 22 additions & 46 deletions packages/wrangler/src/__tests__/cloudchamber/apply.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe("cloudchamber apply", () => {
});
mockGetApplications([]);
mockCreateApplication({ id: "abc" } as Application);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stderr).toMatchInlineSnapshot(`""`);
expect(std.stdout).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -176,7 +176,7 @@ describe("cloudchamber apply", () => {
},
]);
const applicationReqBodyPromise = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand All @@ -194,8 +194,6 @@ describe("cloudchamber apply", () => {
│ - tier = 3
│ + tier = 2
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -256,7 +254,7 @@ describe("cloudchamber apply", () => {
]);
const res = mockModifyApplication();
mockCreateApplication({ id: "abc" } as Application);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
const body = await res;
expect(body).not.toHaveProperty("instances");
/* eslint-disable */
Expand Down Expand Up @@ -287,8 +285,6 @@ describe("cloudchamber apply", () => {
│ [containers.constraints]
│ tier = 1
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -348,7 +344,7 @@ describe("cloudchamber apply", () => {
},
]);
mockCreateApplication({ id: "abc" } as Application);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");

/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -434,7 +430,7 @@ describe("cloudchamber apply", () => {
]);
const res = mockModifyApplication();
mockCreateApplication({ id: "abc" } as Application);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
await res;
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -463,8 +459,6 @@ describe("cloudchamber apply", () => {
│ [containers.constraints]
│ tier = 1
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -572,7 +566,7 @@ describe("cloudchamber apply", () => {
},
]);
const res = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
await res;
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -602,8 +596,6 @@ describe("cloudchamber apply", () => {
│ - [[containers.configuration.secrets]]
│ name = \\"MY_SECRET_2\\"
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -709,7 +701,7 @@ describe("cloudchamber apply", () => {
},
},
]);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand Down Expand Up @@ -823,7 +815,7 @@ describe("cloudchamber apply", () => {
{ ...completeApp, version: 1 },
{ ...completeApp, version: 1, name: "my-container-app-2", id: "abc2" },
]);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand Down Expand Up @@ -936,7 +928,7 @@ describe("cloudchamber apply", () => {
},
},
]);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand Down Expand Up @@ -1050,7 +1042,7 @@ describe("cloudchamber apply", () => {
{ ...completeApp, version: 1 },
{ ...completeApp, version: 1, name: "my-container-app-2", id: "abc2" },
]);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand Down Expand Up @@ -1108,7 +1100,7 @@ describe("cloudchamber apply", () => {
},
]);
const applicationReqBodyPromise = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand All @@ -1127,8 +1119,6 @@ describe("cloudchamber apply", () => {
│ [containers.constraints]
│ ...
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -1182,7 +1172,7 @@ describe("cloudchamber apply", () => {
},
]);
const applicationReqBodyPromise = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand All @@ -1201,8 +1191,6 @@ describe("cloudchamber apply", () => {
│ [containers.constraints]
│ ...
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -1261,7 +1249,7 @@ describe("cloudchamber apply", () => {
},
]);
const applicationReqBodyPromise = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand All @@ -1277,8 +1265,6 @@ describe("cloudchamber apply", () => {
│ [containers.constraints]
│ ...
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -1337,7 +1323,7 @@ describe("cloudchamber apply", () => {
},
]);
const applicationReqBodyPromise = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand All @@ -1353,8 +1339,6 @@ describe("cloudchamber apply", () => {
│ [containers.constraints]
│ ...
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -1412,7 +1396,7 @@ describe("cloudchamber apply", () => {
},
]);
const applicationReqBodyPromise = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand All @@ -1428,8 +1412,6 @@ describe("cloudchamber apply", () => {
│ [containers.constraints]
│ ...
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -1490,7 +1472,7 @@ describe("cloudchamber apply", () => {
},
]);
const applicationReqBodyPromise = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand All @@ -1506,8 +1488,6 @@ describe("cloudchamber apply", () => {
│ [containers.constraints]
│ ...
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -1568,7 +1548,7 @@ describe("cloudchamber apply", () => {
},
},
]);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand Down Expand Up @@ -1622,7 +1602,7 @@ describe("cloudchamber apply", () => {
},
},
]);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand Down Expand Up @@ -1684,7 +1664,7 @@ describe("cloudchamber apply", () => {
},
},
]);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand Down Expand Up @@ -1720,7 +1700,7 @@ describe("cloudchamber apply", () => {
});
mockGetApplications([]);
mockCreateApplication({ id: "abc" } as Application);
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand Down Expand Up @@ -1794,7 +1774,7 @@ describe("cloudchamber apply", () => {
},
]);
const applicationReqBodyPromise = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand All @@ -1818,8 +1798,6 @@ describe("cloudchamber apply", () => {
│ - tier = 3
│ + tier = 2
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down Expand Up @@ -1874,7 +1852,7 @@ describe("cloudchamber apply", () => {
},
]);
const applicationReqBodyPromise = mockModifyApplication();
await runWrangler("cloudchamber apply --json");
await runWrangler("cloudchamber apply");
/* eslint-disable */
expect(std.stdout).toMatchInlineSnapshot(`
"╭ Deploy a container application deploy changes to your application
Expand All @@ -1898,8 +1876,6 @@ describe("cloudchamber apply", () => {
│ - tier = 3
│ + tier = 2
├ Loading
│  SUCCESS  Modified application my-container-app
Expand Down
23 changes: 0 additions & 23 deletions packages/wrangler/src/__tests__/cloudchamber/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ describe("cloudchamber create", () => {
-v, --version Show version number [boolean]

OPTIONS
--json Return output as clean JSON [boolean] [default: false]
--image Image to use for your deployment [string]
--location Location on Cloudflare's network where your deployment will run [string]
--var Container environment variables [array]
Expand Down Expand Up @@ -218,28 +217,6 @@ describe("cloudchamber create", () => {
);
});

it("should fail with a nice message when parameters are missing (json)", async () => {
setIsTTY(false);
setWranglerConfig({});
await runWrangler("cloudchamber create --image hello:world --json");
expect(std.out).toMatchInlineSnapshot(
`"{\\"error\\":\\"location is required but it's not passed as an argument\\"}"`
);
expect(std.err).toMatchInlineSnapshot(`""`);
});

it("should fail with a nice message when instance type is set with memory (json)", async () => {
setIsTTY(false);
setWranglerConfig({});
await runWrangler(
"cloudchamber create --image hello:world --location sfo06 --instance-type dev --memory 400GB --json"
);
expect(std.out).toMatchInlineSnapshot(
`"{\\"error\\":\\"Field /\\"instance_type/\\" is mutually exclusive with /\\"memory/\\" and /\\"vcpu/\\". These fields cannot be set together.\\"}"`
);
expect(std.err).toMatchInlineSnapshot(`""`);
});

it("should create deployment (detects no interactivity)", async () => {
setIsTTY(false);
setWranglerConfig({});
Expand Down
Loading
Loading