From 8bb48764ad509ade845ec5422819acfa20818b2b Mon Sep 17 00:00:00 2001 From: Juan P Lopez Date: Mon, 21 Oct 2024 04:09:22 -0500 Subject: [PATCH] fix: bypass geetest in login phone test --- apps/consent/app/login/phone/server-actions.ts | 2 +- apps/consent/env.ts | 2 ++ dev/Tiltfile | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/consent/app/login/phone/server-actions.ts b/apps/consent/app/login/phone/server-actions.ts index adfb74d602..0cc08c1d4f 100644 --- a/apps/consent/app/login/phone/server-actions.ts +++ b/apps/consent/app/login/phone/server-actions.ts @@ -96,7 +96,7 @@ export const getCaptchaChallenge = async ( const id = res.id const challenge = res.challengeCode - if (env.NODE_ENV === "development") { + if (env.CI || env.NODE_ENV === "development") { const params = new URLSearchParams({ login_challenge, }) diff --git a/apps/consent/env.ts b/apps/consent/env.ts index 2632bd48e9..2d711e255f 100644 --- a/apps/consent/env.ts +++ b/apps/consent/env.ts @@ -9,11 +9,13 @@ export const env = createEnv({ shared: { GRAPHQL_ENDPOINT: z.string().default("http://localhost:4455/graphql"), NODE_ENV: z.string(), + CI: z.boolean().default(false), }, runtimeEnv: { CORE_AUTH_URL: process.env.CORE_AUTH_URL, HYDRA_ADMIN_URL: process.env.HYDRA_ADMIN_URL, GRAPHQL_ENDPOINT: process.env.GRAPHQL_ENDPOINT, NODE_ENV: process.env.NODE_ENV, + CI: process.env.CI, }, }) diff --git a/dev/Tiltfile b/dev/Tiltfile index 0e236ed11b..bfe5014319 100644 --- a/dev/Tiltfile +++ b/dev/Tiltfile @@ -655,6 +655,7 @@ local_resource( local_resource( name="setup-voucher", + labels = ["test"], cmd="buck2 run //dev:setup-voucher-escrow", allow_parallel=False, auto_init=run_apps, @@ -681,6 +682,9 @@ local_resource( ) docker_groups = { + "apps": [ + "voucher-pg", + ], "auth": [ "api-keys-pg", "oathkeeper", @@ -746,6 +750,8 @@ for service in docker_groups["bitcoin"]: dc_resource(service, labels = ["bitcoin"]) for service in docker_groups["tracing"]: dc_resource(service, labels = ["tracing"]) +for service in docker_groups["apps"]: + dc_resource(service, labels = ["apps"]) for service in docker_groups["core"]: dc_resource(service, labels = ["core"]) for service in docker_groups["auth"]: