Skip to content

Commit

Permalink
- re-enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 committed Jul 11, 2024
1 parent 6fadcb0 commit 45e3342
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 124 deletions.
148 changes: 74 additions & 74 deletions .circleci/build-and-test/jobs.yml
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
# test-backend:
# executor: machine-executor
# steps:
# - checkout
# - docker-compose-check
# - docker-compose-up-backend
# - run:
# name: Run Unit Tests And Create Code Coverage Report
# command: |
# cd tdrs-backend;
# docker-compose run --rm web bash -c "./wait_for_services.sh && pytest --cov-report=xml"
# - run:
# name: Execute Python Linting Test
# command: cd tdrs-backend; docker-compose run --rm web bash -c "flake8 ."
# - upload-codecov:
# component: backend
# coverage-report: ./tdrs-backend/coverage.xml
test-backend:
executor: machine-executor
steps:
- checkout
- docker-compose-check
- docker-compose-up-backend
- run:
name: Run Unit Tests And Create Code Coverage Report
command: |
cd tdrs-backend;
docker-compose run --rm web bash -c "./wait_for_services.sh && pytest --cov-report=xml"
- run:
name: Execute Python Linting Test
command: cd tdrs-backend; docker-compose run --rm web bash -c "flake8 ."
- upload-codecov:
component: backend
coverage-report: ./tdrs-backend/coverage.xml

# test-frontend:
# executor: machine-executor
# working_directory: ~/tdp-apps
# steps:
# - checkout
# - install-nodejs-machine
# - disable-npm-audit
# - install-nodejs-packages:
# app-dir: tdrs-frontend
# - run:
# name: Run ESLint
# command: cd tdrs-frontend; npm run lint
# - run:
# name: Run Pa11y Accessibility Tests
# command: cd tdrs-frontend; mkdir pa11y-screenshots/; export NODE_OPTIONS=--openssl-legacy-provider; npm run test:accessibility
# - run:
# name: Run Jest Unit Tests
# command: cd tdrs-frontend; npm run test:ci
# - upload-codecov:
# component: frontend
# coverage-report: ./tdrs-frontend/coverage/lcov.info
# - store_artifacts:
# path: tdrs-frontend/pa11y-screenshots/
test-frontend:
executor: machine-executor
working_directory: ~/tdp-apps
steps:
- checkout
- install-nodejs-machine
- disable-npm-audit
- install-nodejs-packages:
app-dir: tdrs-frontend
- run:
name: Run ESLint
command: cd tdrs-frontend; npm run lint
- run:
name: Run Pa11y Accessibility Tests
command: cd tdrs-frontend; mkdir pa11y-screenshots/; export NODE_OPTIONS=--openssl-legacy-provider; npm run test:accessibility
- run:
name: Run Jest Unit Tests
command: cd tdrs-frontend; npm run test:ci
- upload-codecov:
component: frontend
coverage-report: ./tdrs-frontend/coverage/lcov.info
- store_artifacts:
path: tdrs-frontend/pa11y-screenshots/

# test-e2e:
# executor: large-machine-executor
# working_directory: ~/tdp-apps
# steps:
# - checkout
# - docker-compose-check
# - docker-compose-up-backend
# - docker-compose-up-frontend
# - install-nodejs-machine
# - disable-npm-audit
# - install-nodejs-packages:
# app-dir: tdrs-frontend
# - run:
# name: Wait for backend to become available
# command: cd tdrs-backend; docker-compose run --rm zaproxy bash -c \
# "PATH=$PATH:/home/zap/.local/bin &&
# pip install wait-for-it &&
# wait-for-it --service http://web:8080 --timeout 180 -- echo \"Django is ready\""
# - run:
# name: apply the migrations
# command: cd tdrs-backend; docker-compose exec web bash -c "python manage.py makemigrations; python manage.py migrate"
# - run:
# name: Remove existing cypress test users
# command: cd tdrs-backend; docker-compose exec web python manage.py delete_cypress_users -usernames [email protected] [email protected]
# - run:
# name: Setup cypress test users
# command: cd tdrs-backend; docker-compose exec web python manage.py generate_cypress_users
# - run:
# name: Run Cypress e2e tests
# command: cd tdrs-frontend; npm run test:e2e-ci
# - store_artifacts:
# path: tdrs-frontend/cypress/screenshots/
# - store_artifacts:
# path: tdrs-frontend/cypress/videos/
test-e2e:
executor: large-machine-executor
working_directory: ~/tdp-apps
steps:
- checkout
- docker-compose-check
- docker-compose-up-backend
- docker-compose-up-frontend
- install-nodejs-machine
- disable-npm-audit
- install-nodejs-packages:
app-dir: tdrs-frontend
- run:
name: Wait for backend to become available
command: cd tdrs-backend; docker-compose run --rm zaproxy bash -c \
"PATH=$PATH:/home/zap/.local/bin &&
pip install wait-for-it &&
wait-for-it --service http://web:8080 --timeout 180 -- echo \"Django is ready\""
- run:
name: apply the migrations
command: cd tdrs-backend; docker-compose exec web bash -c "python manage.py makemigrations; python manage.py migrate"
- run:
name: Remove existing cypress test users
command: cd tdrs-backend; docker-compose exec web python manage.py delete_cypress_users -usernames [email protected] [email protected]
- run:
name: Setup cypress test users
command: cd tdrs-backend; docker-compose exec web python manage.py generate_cypress_users
- run:
name: Run Cypress e2e tests
command: cd tdrs-frontend; npm run test:e2e-ci
- store_artifacts:
path: tdrs-frontend/cypress/screenshots/
- store_artifacts:
path: tdrs-frontend/cypress/videos/

secrets-check:
executor: docker-executor
Expand Down
100 changes: 50 additions & 50 deletions .circleci/build-and-test/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
when: << pipeline.parameters.build_and_test_all >>
jobs:
- secrets-check
# - test-backend:
# requires:
# - secrets-check
# - test-frontend:
# requires:
# - secrets-check
# - test-e2e:
# requires:
# - secrets-check
- test-backend:
requires:
- secrets-check
- test-frontend:
requires:
- secrets-check
- test-e2e:
requires:
- secrets-check

ci-build-and-test-all:
jobs:
Expand All @@ -22,46 +22,46 @@
- main
- master
- /^release.*/
# - test-backend:
# filters:
# branches:
# only:
# - main
# - master
# - /^release.*/
# requires:
# - secrets-check
# - test-frontend:
# filters:
# branches:
# only:
# - main
# - master
# - /^release.*/
# requires:
# - secrets-check
# - test-e2e:
# filters:
# branches:
# only:
# - main
# - master
# - /^release.*/
# requires:
# - secrets-check
- test-backend:
filters:
branches:
only:
- main
- master
- /^release.*/
requires:
- secrets-check
- test-frontend:
filters:
branches:
only:
- main
- master
- /^release.*/
requires:
- secrets-check
- test-e2e:
filters:
branches:
only:
- main
- master
- /^release.*/
requires:
- secrets-check

# build-and-test-backend:
# when: << pipeline.parameters.build_and_test_backend >>
# jobs:
# - secrets-check
# - test-backend:
# requires:
# - secrets-check
build-and-test-backend:
when: << pipeline.parameters.build_and_test_backend >>
jobs:
- secrets-check
- test-backend:
requires:
- secrets-check

# build-and-test-frontend:
# when: << pipeline.parameters.build_and_test_frontend >>
# jobs:
# - secrets-check
# - test-frontend:
# requires:
# - secrets-check
build-and-test-frontend:
when: << pipeline.parameters.build_and_test_frontend >>
jobs:
- secrets-check
- test-frontend:
requires:
- secrets-check

0 comments on commit 45e3342

Please sign in to comment.