mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-14 14:27:45 +02:00
84 lines
2.2 KiB
TypeScript
84 lines
2.2 KiB
TypeScript
import * as GCP from "@/GCP";
|
|
import * as Test from "@/Test/Alchemy";
|
|
import { expect } from "alchemy-test";
|
|
import * as Effect from "effect/Effect";
|
|
import { cloneFixture } from "../../Cloudflare/Utils/Fixture.ts";
|
|
import { expectUrlContains } from "../../Cloudflare/Utils/Http.ts";
|
|
import { dockerAvailable } from "../bindingHost.ts";
|
|
import {
|
|
assertSiteGone,
|
|
awsFixture,
|
|
cloudRunUrl,
|
|
liveOptions,
|
|
logLevel,
|
|
serviceIdentity,
|
|
tempRoot,
|
|
} from "./site.ts";
|
|
|
|
const { test } = Test.make({ providers: GCP.providers() });
|
|
|
|
const fixtureDir = awsFixture("octane-app");
|
|
const fixtureEntries = [
|
|
".gitignore",
|
|
"package.json",
|
|
"octane.config.ts",
|
|
"vite.config.ts",
|
|
"index.html",
|
|
"src",
|
|
"public",
|
|
];
|
|
|
|
test.provider.skipIf(!dockerAvailable)(
|
|
"Octane: deploy, GET page and API route, destroy, gone",
|
|
(stack) =>
|
|
Effect.gen(function* () {
|
|
yield* stack.destroy();
|
|
|
|
const rootDir = yield* cloneFixture(fixtureDir, {
|
|
prefix: "alchemy-octane-gcp-",
|
|
tempRoot,
|
|
entries: fixtureEntries,
|
|
});
|
|
|
|
const deployed = yield* stack.deploy(
|
|
Effect.gen(function* () {
|
|
const site = yield* GCP.Website.Octane("Web", {
|
|
rootDir,
|
|
memo: {
|
|
include: [
|
|
"src/**",
|
|
"public/**",
|
|
"package.json",
|
|
"octane.config.ts",
|
|
"vite.config.ts",
|
|
"index.html",
|
|
],
|
|
},
|
|
});
|
|
return { site };
|
|
}),
|
|
);
|
|
|
|
const url = deployed.site.url as string;
|
|
expect(url).toMatch(cloudRunUrl);
|
|
expect(deployed.site.service).toBeDefined();
|
|
const service = serviceIdentity(deployed.site.service!);
|
|
|
|
yield* expectUrlContains(`${url}/`, "OCTANE_AWS_PAGE_MARKER", {
|
|
timeout: "180 seconds",
|
|
label: "Octane /",
|
|
});
|
|
yield* expectUrlContains(
|
|
`${url}/api/hello?echo=roundtrip`,
|
|
"OCTANE_AWS_API_MARKER",
|
|
{
|
|
timeout: "30 seconds",
|
|
label: "Octane /api/hello?echo=roundtrip",
|
|
},
|
|
);
|
|
|
|
yield* stack.destroy();
|
|
yield* assertSiteGone(service);
|
|
}).pipe(logLevel),
|
|
liveOptions(900_000),
|
|
);
|