Skip to content

Commit 4e9e73a

Browse files
committed
chore: test 명령어 통합
1 parent eb83e42 commit 4e9e73a

3 files changed

Lines changed: 40 additions & 33 deletions

File tree

.github/workflows/backend-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
run: just test backend
6868

6969
- name: Run e2e tests
70-
run: just test-e2e
70+
run: just test e2e
7171
env:
7272
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
7373
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}

.github/workflows/e2e-ui-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
run: just deps-playwright
7373

7474
- name: Run E2E UI tests
75-
run: just test-e2e-ui
75+
run: just test e2e-ui
7676

7777
- name: Upload test report
7878
if: always()

justfile

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,15 @@ setup-testdb:
272272
cd "{{ backend_dir }}"
273273
DATABASE_URL="{{ testdb_url }}" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm prisma migrate dev
274274

275-
test target *args:
275+
test target="all" *args:
276276
#!/usr/bin/env bash
277277
set -euox pipefail
278278
case "{{ target }}" in
279+
all)
280+
just test backend
281+
just test e2e
282+
just test e2e-ui
283+
;;
279284
backend)
280285
echo "NodeJS:" $(node -v)
281286
echo "Prisma Engine:" {{ prisma_engine }}
@@ -284,38 +289,40 @@ test target *args:
284289
cd "{{ backend_dir }}"
285290
DATABASE_URL="postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" NODE_OPTIONS="--max_old_space_size=8192" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm exec jest --runInBand --logHeapUsage --no-compilation-cache --silent=false {{ args }}
286291
;;
287-
esac
288-
289-
test-e2e *args:
290-
#!/usr/bin/env bash
291-
set -euox pipefail
292-
echo "NodeJS:" $(node -v)
293-
echo "Prisma Engine:" {{ prisma_engine }}
294-
295-
just setup-testdb
296-
cd "{{ backend_dir }}"
297-
DATABASE_URL="postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" NODE_OPTIONS="--max_old_space_size=8192" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm exec jest --config ./jest-e2e.json --runInBand --no-compilation-cache --forceExit {{ args }}
292+
e2e)
293+
echo "NodeJS:" $(node -v)
294+
echo "Prisma Engine:" {{ prisma_engine }}
298295

299-
test-e2e-ui mode="":
300-
#!/usr/bin/env bash
301-
set -euo pipefail
302-
if [ "{{ mode }}" = "report" ]; then
303-
if [ ! -f "playwright-report/index.html" ]; then
304-
echo "No report found. Run tests first: just test-e2e-ui"
296+
just setup-testdb
297+
cd "{{ backend_dir }}"
298+
DATABASE_URL="postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" NODE_OPTIONS="--max_old_space_size=8192" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm exec jest --config ./jest-e2e.json --runInBand --no-compilation-cache --forceExit {{ args }}
299+
;;
300+
e2e-ui)
301+
set +x
302+
if [ "{{ args }}" = "report" ]; then
303+
if [ ! -f "playwright-report/index.html" ]; then
304+
echo "No report found. Run tests first: just test e2e-ui"
305+
exit 1
306+
fi
307+
pnpm test:e2e-ui:report
308+
else
309+
set -x
310+
# Kill any existing backend processes and wait for termination
311+
pkill -f "nest start" || true
312+
while pgrep -f "nest start" > /dev/null; do sleep 0.5; done
313+
314+
just setup-testdb
315+
cd "{{ backend_dir }}"
316+
DATABASE_URL="postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm prisma db seed
317+
cd "{{ root_dir }}"
318+
pnpm test:e2e-ui
319+
fi
320+
;;
321+
*)
322+
echo "Unknown target: {{ target }}"
305323
exit 1
306-
fi
307-
pnpm test:e2e-ui:report
308-
else
309-
# Kill any existing backend processes and wait for termination
310-
pkill -f "nest start" || true
311-
while pgrep -f "nest start" > /dev/null; do sleep 0.5; done
312-
313-
just setup-testdb
314-
cd "{{ backend_dir }}"
315-
DATABASE_URL="postgres://postgres:postgres@localhost:5432/test?pool_timeout=60" PRISMA_CLIENT_ENGINE_TYPE={{ prisma_engine }} pnpm prisma db seed
316-
cd "{{ root_dir }}"
317-
pnpm test:e2e-ui
318-
fi
324+
;;
325+
esac
319326

320327
run-backend-prod:
321328
./scripts/run-backend-prod.sh

0 commit comments

Comments
 (0)