Skip to content

Commit 0ccb233

Browse files
Creating a Separate test-server Service (#431)
* creating a seperate test-server service * adding reflected changeS
1 parent 3056001 commit 0ccb233

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ down:
181181
@echo "Shutting down all docker compose services..."
182182
@docker compose down
183183

184+
.PHONY: test-down
185+
test-down:
186+
@echo "Shutting down all test docker compose services..."
187+
@docker compose -f compose.test.yml down
188+
184189
.PHONY: test-setup
185190
test-setup:
186191
@echo "Setting up test database..."
@@ -206,7 +211,7 @@ test: test-setup
206211
@$(MAKE) test-frontend
207212

208213
.PHONY: playwright-local
209-
playwright-local: test-system-setup build-frontend-test-assets
214+
playwright-local: test-down test-system-setup build-frontend-test-assets
210215
@cd playwright; \
211216
npx playwright test --project=local
212217

@@ -264,7 +269,7 @@ test-system-setup: test-setup
264269

265270
.PHONY: test-server
266271
test-server: test-system-setup build-frontend-test-assets
267-
bin/npr --test --publish 8008:8008 python manage.py runserver 0.0.0.0:8008
272+
docker compose -f compose.test.yml up django-web
268273

269274
###
270275
# whole project concerns

compose.test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
name: npd
22

3-
# by using `compose.test.yml` alone with `docker compose -f compose.test.yml and
4-
# the `extends:` settings for each of the named services, we can merge these
5-
# service definitions cleanly with the ones that already exist in the base
6-
# compose.yml file
7-
83
services:
94
db:
105
extends:
@@ -35,6 +30,9 @@ services:
3530
depends_on: !override
3631
- db
3732
- db-migrations
33+
command: python manage.py runserver 0.0.0.0:8008
34+
ports:
35+
- "8008:8008"
3836

3937
volumes:
4038
postgres_data:

playwright/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export default defineConfig({
103103
/* Run your local dev server before starting the tests */
104104
webServer: {
105105
cwd: "../",
106-
command: "bin/npr --test --publish 8008:8008 python manage.py runserver 0.0.0.0:8008",
106+
command: "docker compose -f compose.test.yml up django-web",
107107
url: "http://localhost:8008",
108108
reuseExistingServer: !process.env.CI,
109109
timeout: 300000, // give at least 5 minutes to download all container dependencies

0 commit comments

Comments
 (0)