test ci --check

This commit is contained in:
Gsk54 2023-01-10 12:08:08 +01:00
parent 2caf8bbac6
commit 33b9a9e74f
2 changed files with 10 additions and 11 deletions

View File

@ -7,15 +7,15 @@ stages:
# TEST STAGE # # TEST STAGE #
############## ##############
# unit-test: unit-test:
# stage: test stage: test
# image: node:18-alpine3.16 image: node:18-alpine3.16
# script: script:
# - npm install - npm install
# - npm run test:unit - npm run test:unit
# rules: rules:
# - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_MESSAGE =~ /--check/ || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_MESSAGE =~ /--check/ || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
# when: always when: always
integration-test: integration-test:
stage: test stage: test
@ -27,7 +27,6 @@ integration-test:
script: script:
- docker-compose -f docker-compose.ci.yml --env-file ci/.env.ci up -d - docker-compose -f docker-compose.ci.yml --env-file ci/.env.ci up -d
- sh ci/wait-up.sh - sh ci/wait-up.sh
- docker-compose -f docker-compose.ci.yml --env-file ci/.env.ci logs
- docker exec -t v3-user sh -c "npm run test:integration:ci" - docker exec -t v3-user sh -c "npm run test:integration:ci"
rules: rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_MESSAGE =~ /--check/ || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_MESSAGE =~ /--check/ || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'

View File

@ -17,7 +17,7 @@
"test": "npm run migrate:test && dotenv -e .env.test jest", "test": "npm run migrate:test && dotenv -e .env.test jest",
"test:unit": "jest --testPathPattern 'tests/unit/' --verbose", "test:unit": "jest --testPathPattern 'tests/unit/' --verbose",
"test:integration": "npm run migrate:test && dotenv -e .env.test -- jest --testPathPattern 'tests/integration/' --verbose", "test:integration": "npm run migrate:test && dotenv -e .env.test -- jest --testPathPattern 'tests/integration/' --verbose",
"test:integration:ci": "npm run migrate:test:ci && dotenv -e ci/.env.ci -- jest --testPathPattern 'tests/integration/' --verbose", "test:integration:ci": "npm run migrate:test:ci && dotenv -e ci/.env.ci -- jest --testPathPattern 'tests/integration/'",
"test:cov": "npm run migrate:test && dotenv -e .env.test -- jest --coverage", "test:cov": "npm run migrate:test && dotenv -e .env.test -- jest --coverage",
"test:e2e": "jest --config ./test/jest-e2e.json", "test:e2e": "jest --config ./test/jest-e2e.json",
"migrate": "docker exec v3-user sh -c 'npx prisma migrate dev'", "migrate": "docker exec v3-user sh -c 'npx prisma migrate dev'",