@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 36 lines 1.3 KB
Raw
1 import * as GCP from "@alchemy.run/gcp";
2 import { expect } from "@alchemy.run/test";
3 import * as Test from "@alchemy.run/test/Alchemy";
4 import * as artifactregistry from "@distilled.cloud/gcp/artifactregistry_v1";
5 import * as Region from "@distilled.cloud/gcp/Region";
6 import * as Effect from "effect/Effect";
7 import * as Layer from "effect/Layer";
8
9 const { test } = Test.make({
10 providers: GCP.providers().pipe(
11 Layer.provideMerge(GCP.Region("us-east4")),
12 Layer.provideMerge(GCP.RegionalEndpoints("prefer")),
13 ),
14 });
15
16 test.provider(
17 "GCP.RegionalEndpoints('prefer') on the providers layer deploys through the regional endpoint",
18 (stack) =>
19 Effect.gen(function* () {
20 yield* stack.destroy();
21 const repo = yield* stack.deploy(
22 GCP.ArtifactRegistry.Repository("PreferRepo", { format: "DOCKER" }),
23 );
24 expect(repo.name).toContain("/locations/us-east4/");
25 // The same resource is reachable through the regional host directly.
26 const live = yield* artifactregistry
27 .getProjectsLocationsRepositories({ name: repo.name })
28 .pipe(Effect.provide(Region.regionalEndpoints("prefer")));
29 expect(live.name).toEqual(repo.name);
30 yield* stack.destroy();
31 }),
32 {
33 tags: ["provider:gcp", "provider:gcp:artifactregistry", "live"],
34 timeout: 180_000,
35 },
36 );