forked from oppia/oppia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port back-end tests from Travis to CircleCI (oppia#6234)
* Basic config * Minor nit * Test caching mechanism * Try integration of frontend and backend tests * Syntax fix * Add defaults back to each job * Add checkout for each job * Add checkout to setup job * Add anchor for restore_cache * Add e2e tests accessiblity * Add third_party_cache and setup_cache key * Fix cache paths * Change working dir path * Use abs paths for cache * Try specifying chrome version * Add libappindicator * Tweak * Try fixing path and run only e2e tests * Add lint, frontend and backend tests to config.yml * Remove lint, frontend and backend tests from travis.yml * Remove undefined anchor * Fix yml * Install dependencies * Minor tweaks * Move init hook to Master section in pylintrc * Test commit: try changing the working dir * Port backend tests from Travis to CircleCi * Revert changes made in pylintrc * Revert changes to Travis and comment out backend and frontend tests' run * Run frontend and generate coverage * Install codecov as a dependency * Add sudo to overcome permission error * Re-order codecov install * Add branches to be build and try enabling backend test coverage * Fix config * Remove branch section * Try: lint tests * Try: lint tests * Try: Add dependency installation to lint tests job * Try: Caching * Try: Caching * Try: Caching * Try: Caching * Try: Caching * Try: Caching * Run lint, frontend and backend tests * Generate date for each job * Comment out lint test and re-order third party installation * Fix Travis * Remove --generate_coverage_report flag from backend tests job * Add explanation to travis config for commenting checks out * Re-order dependency install * Re-order dependency * Revert: Remove --generate_coverage_report flag from backend tests job * Remove third party install from lint check
- Loading branch information
Showing
2 changed files
with
122 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
var_for_docker_image: &docker_image circleci/python:2.7.14-jessie-browsers | ||
|
||
anchor_for_job_defaults: &job_defaults | ||
working_directory: /home/circleci/oppia | ||
docker: | ||
- image: *docker_image | ||
|
||
anchor_for_installing_dependencies: &install_dependencies | ||
name: Install dependencies | ||
command: | | ||
source scripts/setup.sh || exit 1 | ||
source scripts/setup_gae.sh || exit 1 | ||
anchor_for_restoring_cache: &restore_cache | ||
keys: | ||
- setup-files-cache-{{ checksum "date" }} | ||
- third-party-cache-{{ checksum "date" }} | ||
|
||
version: 2 | ||
jobs: | ||
setup: | ||
<<: *job_defaults | ||
steps: | ||
- checkout | ||
- run: date +%F > date | ||
- restore_cache: | ||
<<: *restore_cache | ||
- run: | ||
<<: *install_dependencies | ||
- save_cache: | ||
key: setup-files-cache-{{ checksum "date" }} | ||
paths: | ||
- ../node_modules/ | ||
- ../oppia_tools/ | ||
|
||
lint_tests: | ||
<<: *job_defaults | ||
steps: | ||
- checkout | ||
- run: date +%F > date | ||
- restore_cache: | ||
<<: *restore_cache | ||
- run: | ||
name: Run lint tests | ||
command: | | ||
bash scripts/install_third_party.sh | ||
python scripts/third_party_size_check.py | ||
python scripts/pre_commit_linter.py --path=. | ||
- save_cache: | ||
key: third-party-cache-{{ checksum "date" }} | ||
paths: | ||
- third_party/ | ||
|
||
frontend_tests: | ||
<<: *job_defaults | ||
steps: | ||
- checkout | ||
- run: date +%F > date | ||
- restore_cache: | ||
<<: *restore_cache | ||
- run: | ||
name: Run frontend tests | ||
command: | | ||
bash -x scripts/run_frontend_tests.sh --run-minified-tests=true | ||
- run: | ||
name: Generate frontend coverage report | ||
command: | | ||
sudo pip install codecov | ||
codecov --file ../karma_coverage_reports/coverage-final.json | ||
when: on_success | ||
|
||
backend_tests: | ||
<<: *job_defaults | ||
steps: | ||
- checkout | ||
- run: date +%F > date | ||
- restore_cache: | ||
<<: *restore_cache | ||
- run: | ||
name: Run backend tests | ||
command: | | ||
bash scripts/run_backend_tests.sh --generate_coverage_report --exclude_load_tests | ||
- run: | ||
name: Generate backend coverage report | ||
command: | | ||
sudo pip install codecov | ||
codecov | ||
when: on_success | ||
|
||
workflows: | ||
version: 2 | ||
circleci_tests: | ||
jobs: | ||
- setup | ||
- lint_tests: | ||
requires: | ||
- setup | ||
- frontend_tests: | ||
requires: | ||
- setup | ||
- backend_tests: | ||
requires: | ||
- setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters