File tree Expand file tree Collapse file tree 5 files changed +26
-6
lines changed
packages/hono-helpers/src Expand file tree Collapse file tree 5 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 5555 runs-on : ubuntu-latest
5656 timeout-minutes : 15
5757
58+ services :
59+ postgres :
60+ image : postgres:16
61+ env :
62+ POSTGRES_USER : postgres
63+ POSTGRES_PASSWORD : postgres
64+ POSTGRES_DB : poppy_test
65+ options : >-
66+ --health-cmd pg_isready
67+ --health-interval 10s
68+ --health-timeout 5s
69+ --health-retries 5
70+ ports :
71+ - 5432:5432
72+
5873 steps :
5974 - name : Checkout code
6075 uses : actions/checkout@v4
8398 - name : Install dependencies
8499 run : pnpm install --frozen-lockfile
85100
101+ - name : Setup database schema
102+ run : pnpm --filter @poppy/db db:push
103+ env :
104+ DATABASE_URL : postgresql://postgres:postgres@localhost:5432/poppy_test
105+
86106 - name : Run tests
87107 run : pnpm test
88108 env :
89109 NODE_ENV : test
90- DATABASE_URL : ${{ secrets.DATABASE_URL }}
91- CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE : ${{ secrets.DATABASE_URL }}
110+ DATABASE_URL : postgresql://postgres:postgres@localhost:5432/poppy_test
111+ CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_HYPERDRIVE : postgresql://postgres:postgres@localhost:5432/poppy_test
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ import type { WorkerEnv } from "../context";
77 * @returns Drizzle database instance with all schemas
88 */
99export function createDatabaseClient ( env : WorkerEnv ) {
10- const isTest = process . env . NODE_ENV === "test" ;
10+ const isTest = env . NODE_ENV === "test" ;
11+ console . log ( env ) ;
1112 // Use Hyperdrive connection string for optimized PostgreSQL access
1213 return getDb (
1314 isTest ? process . env . DATABASE_URL : env . HYPERDRIVE . connectionString ,
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ app.get("/health", async (c) => {
4747
4848// Webhook handler at root
4949app . post ( "/" , async ( c ) => {
50- console . log ( process . env ) ;
5150 const body = await c . req . json ( ) ;
5251 console . log ( "Received webhook payload" , body ) ;
5352
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export default defineWorkersProject({
1818 "enable_nodejs_http_modules" ,
1919 ] ,
2020 bindings : {
21- ENVIRONMENT : "VITEST " ,
21+ NODE_ENV : "test " ,
2222 } ,
2323 durableObjects : {
2424 MESSAGE_DEBOUNCER : "MessageDebouncer" ,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { z } from "zod";
22
33export type WorkersEnvironment = z . infer < typeof WorkersEnvironment > ;
44export const WorkersEnvironment = z . enum ( [
5- "VITEST " ,
5+ "test " ,
66 "development" ,
77 "staging" ,
88 "production" ,
You can’t perform that action at this time.
0 commit comments