Skip to content

Commit

Permalink
(#143) corrige separacao de testes unit e e2e
Browse files Browse the repository at this point in the history
Co-authored-by: Pedro Cella <[email protected]>
  • Loading branch information
HenriqueAmorim20 and pedro-cella committed Oct 22, 2023
1 parent f38657a commit 528e696
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
14 changes: 5 additions & 9 deletions .docker/entrypoint.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ npm run lint
npm run typeorm:run


if ! [ -z $TEST ] && [ $TEST == 'unit' ]; then
if ! [ -z $TEST ] && [ $TEST == 'test' ]; then
echo "Running unit tests"
npm run test:cov
elif ! [ -z $TEST ] && [ $TEST == 'e2e' ]; then
echo "Running e2e tests"
npm run test:e2e:cov
elif ! [ -z $TEST ] && [ $TEST == 'lint' ]; then
echo "Running lint"
npm run lint
npm run format
npm run test

echo "Running E2E tests"
npm run test:e2e
else
echo "Running test"
npm run start:dev
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,12 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Test Unit
id: test-unit
- name: Test Unit and E2E
id: test-unit-e2e
run: |
TEST=unit docker-compose -f docker-compose.test.yml up -V --force-recreate --build --abort-on-container-exit --exit-code-from gerocuidado-usuario-api-test
TEST=test docker-compose -f docker-compose.test.yml up -V --force-recreate --build --abort-on-container-exit --exit-code-from gerocuidado-usuario-api-test
env:
TEST: unit

- name: Test E2E
id: test-e2e
run: |
TEST=e2e docker-compose -f docker-compose.test.yml up -V --force-recreate --build --abort-on-container-exit --exit-code-from gerocuidado-usuario-api-test
env:
TEST: e2e
TEST: test

- name: Build and push Docker image
id: build-and-push
Expand Down

0 comments on commit 528e696

Please sign in to comment.