t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/GCP/RegionalEndpoints.test.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

36 lines
1.3 KiB
TypeScript

import * as GCP from "@/GCP";
import * as Test from "@/Test/Alchemy";
import * as artifactregistry from "@distilled.cloud/gcp/artifactregistry_v1";
import * as Region from "@distilled.cloud/gcp/Region";
import { expect } from "alchemy-test";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
const { test } = Test.make({
providers: GCP.providers().pipe(
Layer.provideMerge(GCP.Region("us-east4")),
Layer.provideMerge(GCP.RegionalEndpoints("prefer")),
),
});
test.provider(
"GCP.RegionalEndpoints('prefer') on the providers layer deploys through the regional endpoint",
(stack) =>
Effect.gen(function* () {
yield* stack.destroy();
const repo = yield* stack.deploy(
GCP.ArtifactRegistry.Repository("PreferRepo", { format: "DOCKER" }),
);
expect(repo.name).toContain("/locations/us-east4/");
// The same resource is reachable through the regional host directly.
const live = yield* artifactregistry
.getProjectsLocationsRepositories({ name: repo.name })
.pipe(Effect.provide(Region.regionalEndpoints("prefer")));
expect(live.name).toEqual(repo.name);
yield* stack.destroy();
}),
{
tags: ["provider:gcp", "provider:gcp:artifactregistry", "live"],
timeout: 180_000,
},
);