Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 1 addition & 6 deletions .oxlintrc.effect.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@
"!apps/cli/src/commands/encryption/**",
"!apps/cli/src/commands/experimental/**",
"!apps/cli/src/commands/feedback/**",
"!apps/cli/src/commands/functions/functions.command.ts",
"!apps/cli/src/commands/functions/delete/**",
"!apps/cli/src/commands/functions/deploy/**",
"!apps/cli/src/commands/functions/list/**",
"!apps/cli/src/commands/functions/new/**",
"!apps/cli/src/commands/functions/serve/**",
"!apps/cli/src/commands/functions/**",
"!apps/cli/src/commands/init/**",
"!apps/cli/src/commands/issue/**",
"!apps/cli/src/commands/link/**",
Expand Down
35 changes: 21 additions & 14 deletions apps/cli/src/commands/functions/download/download.e2e.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { describe, expect, test } from "vitest";
import { makeTempHome, runSupabase } from "../../../../tests/helpers/cli.ts";
import { describe, expect, it } from "@effect/vitest";
import { Effect } from "effect";
import { runSupabaseEffect, withTempHome } from "../../../../tests/helpers/cli.ts";

// Argument-validation negatives for `functions download`, mirroring
// `deploy.e2e.test.ts`. These fail before any network call, so no auth or
Expand All @@ -18,18 +19,24 @@ describe("supabase functions download — argument validation", () => {
] as const;

for (const { name, flags } of conflicts) {
test(`rejects ${name} as mutually exclusive`, { timeout: E2E_TIMEOUT_MS }, async () => {
using home = makeTempHome();
const { exitCode, stderr } = await runSupabase(
["functions", "download", SLUG, "--project-ref", FAKE_REF, ...flags],
{
home: home.dir,
env: { HOME: home.dir, SUPABASE_ACCESS_TOKEN: FAKE_TOKEN },
},
);
expect(exitCode).not.toBe(0);
expect(stderr).toMatch(/none of the others can be|mutually exclusive/i);
});
it.live(
`rejects ${name} as mutually exclusive`,
() =>
withTempHome((home) =>
Effect.gen(function* () {
const { exitCode, stderr } = yield* runSupabaseEffect(
["functions", "download", SLUG, "--project-ref", FAKE_REF, ...flags],
{
home: home.dir,
env: { HOME: home.dir, SUPABASE_ACCESS_TOKEN: FAKE_TOKEN },
},
);
expect(exitCode).not.toBe(0);
expect(stderr).toMatch(/none of the others can be|mutually exclusive/i);
}),
),
E2E_TIMEOUT_MS,
);
}

// `--use-api` alone (without --use-docker) is covered in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { join } from "node:path";
import { Effect, Option, Stdio } from "effect";
import { Effect, Option, Path, Stdio } from "effect";
import {
downloadFunctions,
makeGoProxyLegacyBundleArgs,
Expand Down Expand Up @@ -27,9 +26,10 @@ export const functionsDownload = Effect.fn("functions.download")(function* (
const proxy = yield* GoProxy;
const output = yield* Output;
const stdio = yield* Stdio.Stdio;
const path = yield* Path.Path;
const rawArgs = yield* stdio.args;
const edgeRuntimeVersion = yield* resolveEdgeRuntimeVersionPin(
join(cliSettings.workdir, "supabase"),
path.join(cliSettings.workdir, "supabase"),
);
let resolvedProjectRef = Option.none<string>();

Expand Down
Loading
Loading