File tree 5 files changed +69
-7
lines changed
5 files changed +69
-7
lines changed Original file line number Diff line number Diff line change @@ -240,12 +240,12 @@ jobs:
240
240
- run :
241
241
name : Start up local server
242
242
command : | # production style build (single BE server with static FE)
243
- docker-compose -f docker-compose-test .yml run --rm server yarn install --production=false
244
- docker-compose -f docker-compose-test .yml run --rm server yarn --cwd frontend install --production=false
245
- docker-compose -f docker-compose-test .yml run --rm server yarn build
246
- docker-compose -f docker-compose-test .yml run --rm server yarn --cwd frontend run build
247
- docker-compose -f docker-compose-test .yml up -d
248
- docker-compose -f docker-compose-test .yml exec server yarn db:migrate:ci
243
+ docker-compose -f docker-compose.dss .yml run --rm server yarn install --production=false
244
+ docker-compose -f docker-compose.dss .yml run --rm server yarn --cwd frontend install --production=false
245
+ docker-compose -f docker-compose.dss .yml run --rm server yarn build
246
+ docker-compose -f docker-compose.dss .yml run --rm server yarn --cwd frontend run build
247
+ docker-compose -f docker-compose.dss .yml up -d
248
+ docker-compose -f docker-compose.dss .yml exec server yarn db:migrate:ci
249
249
- run :
250
250
name : Pull OWASP ZAP docker image
251
251
command : docker pull owasp/zap2docker-weekly
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ echo " Running tests in using test config 'docker-compose.test.yml'"
4
+ # Start containers
5
+ docker-compose -f ' docker-compose.test.yml' up -d
6
+
7
+ # Let postgres initialize
8
+ echo " Give postgres a few seconds to start up..."
9
+ sleep 5
10
+
11
+ # Migrate and seed db
12
+ docker exec test-backend bash -c " yarn db:migrate"
13
+ docker exec test-backend bash -c " yarn db:seed;"
14
+
15
+ # Test backend
16
+ docker exec test-backend bash -c " yarn test:ci"
17
+
18
+ # Test frontend
19
+ docker exec test-backend bash -c " yarn --cwd frontend run test:ci"
20
+
21
+ # Cleanup
22
+ docker-compose \
23
+ -f ' docker-compose.test.yml' \
24
+ down --volumes
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ version : " 3.5"
2
+ services :
3
+ test-backend :
4
+ build :
5
+ context : .
6
+ container_name : test-backend
7
+ command : yarn server
8
+ user : ${CURRENT_USER:-root}
9
+ depends_on :
10
+ - test-db
11
+ environment :
12
+ - POSTGRES_HOST=test-db
13
+ volumes :
14
+ - " .:/app:rw"
15
+ networks :
16
+ - ttadp-test
17
+ test-frontend :
18
+ build :
19
+ context : .
20
+ command : yarn start
21
+ user : ${CURRENT_USER:-root}
22
+ stdin_open : true
23
+ volumes :
24
+ - " ./frontend:/app:rw"
25
+ - " ./scripts:/app/scripts"
26
+ environment :
27
+ - BACKEND_PROXY=http://test-backend:8080
28
+ networks :
29
+ - ttadp-test
30
+ test-db :
31
+ image : postgres:12.4
32
+ container_name : test-db
33
+ env_file : .env
34
+ networks :
35
+ - ttadp-test
36
+ # Use non-default network so we don't conflict with the developer environment
37
+ networks :
38
+ ttadp-test :
Original file line number Diff line number Diff line change 42
42
"docker:deps" : " docker-compose run --rm backend yarn install && docker-compose run --rm frontend yarn install" ,
43
43
"docker:start" : " docker-compose up" ,
44
44
"docker:stop" : " docker-compose down" ,
45
- "docker:test" : " docker-compose run --rm backend yarn test:ci && docker-compose run --rm frontend yarn test:ci " ,
45
+ "docker:test" : " ./bin/ run-tests " ,
46
46
"docker:test:be" : " docker-compose run --rm backend yarn test" ,
47
47
"docker:lint" : " docker-compose run --rm backend yarn lint:ci && docker-compose run --rm frontend yarn lint:ci" ,
48
48
"docker:shell:frontend" : " docker-compose run --rm frontend /bin/bash" ,
You can’t perform that action at this time.
0 commit comments