| 1 | import { GcpEnvironment } from "@/GCP/Environment"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import { MinimumLogLevel } from "effect/References"; |
| 4 | |
| 5 | // Needs a Chrome Enterprise Premium (BeyondCorp Enterprise) subscription |
| 6 | // (GCP_TEST_CHROME_ENTERPRISE_PREMIUM=1). Without it, app connector/connection/ |
| 7 | // gateway creates fail with `AppConnectorsNotImplemented` (HTTP 501 "This |
| 8 | // function is not implemented") and security gateway creates fail with |
| 9 | // `BadRequest: ... Chrome Enterprise Premium SKU is not enabled.` |
| 10 | export const runLifecycle = !!process.env.GCP_TEST_CHROME_ENTERPRISE_PREMIUM; |
| 11 | |
| 12 | export const currentProject = GcpEnvironment.current.pipe( |
| 13 | Effect.map((env) => env.project), |
| 14 | ); |
| 15 | |
| 16 | export const serviceAccountEmailOf = (project: string) => |
| 17 | process.env.GOOGLE_CONNECTOR_SA_EMAIL ?? |
| 18 | `alchemy-testing@${project}.iam.gserviceaccount.com`; |
| 19 | |
| 20 | export const logLevel = Effect.provideService( |
| 21 | MinimumLogLevel, |
| 22 | process.env.DEBUG ? "Debug" : "Info", |
| 23 | ); |