test ci --check

This commit is contained in:
Gsk54 2023-01-09 16:31:15 +01:00
parent 2db903cd1c
commit fe24afb712
4 changed files with 4 additions and 6 deletions

View File

@ -19,9 +19,6 @@ test-api-dev:
- docker:dind
script:
- docker-compose -f docker-compose.ci.yml --env-file .env.test up -d
- sh ci/wait-up.sh
- docker-compose -f docker-compose.ci.yml --env-file .env.test logs
- docker exec -t v3-user sh -c "npm run test"
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_MESSAGE =~ /--check/ || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: always

View File

@ -19,5 +19,5 @@ COPY . .
# Creates a "dist" folder
RUN npm run build
# Start the server
CMD [ "node", "dist/main.js" ]
# Execute test suite
RUN npm run test

View File

@ -1,5 +1,5 @@
#!/bin/bash
while ! docker logs v3-user-db-test --tail=1 | grep -q "database system is ready to accept connections";
while ! docker logs v3-user-db-test --tail=1 | grep -q -i "database system is ready to accept connections";
do
sleep 5
echo "Waiting for Test DB to be up..."

View File

@ -8,6 +8,7 @@ services:
context: .
env_file:
- .env.test
command: npm run test
ports:
- 5001:5001
depends_on: