diff --git a/.circleci/config.yml b/.circleci/config.yml index a3a42a64..a19ae9cc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,59 +1,57 @@ +# Python CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-python/ for more details +# version: 2 jobs: build: docker: - - image: circleci/python:3.6.2-stretch-browsers - environment: - FLASK_CONFIG: testing - TEST_DATABASE_URL: postgresql://ubuntu@localhost/circle_test?sslmode=disable - - image: circleci/postgres:9.6.5-alpine-ram - environment: - POSTGRES_USER: ubuntu - POSTGRES_DB: circle_test - POSTGRES_PASSWORD: "" + # specify the version you desire here + # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` + - image: circleci/python:3.6.1 + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/postgres:9.4 + + working_directory: ~/repo + steps: - checkout - - run: mkdir test-reports - - run: - name: Download Selenium - command: | - curl -O http://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.5.3.jar - - run: - name: Start Selenium - command: | - java -jar selenium-server-standalone-3.5.3.jar -log test-reports/selenium.log - background: true + + # Download and cache dependencies - restore_cache: - key: deps1-{{ .Branch }}-{{ checksum "requirements/dev.txt" }} + keys: + - v1-dependencies-{{ checksum "requirements.txt" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + - run: + name: install dependencies command: | python3 -m venv venv . venv/bin/activate - pip install -r requirements/dev.txt - - run: - name: setup Heroku - command: bash .circleci/setup-heroku.sh + pip install -r requirements.txt + - save_cache: - key: deps1-{{ .Branch }}-{{ checksum "requirements/dev.txt" }} paths: - - "venv" + - ./venv + key: v1-dependencies-{{ checksum "requirements.txt" }} + + # run tests! + # this example uses Django's built-in test-runner + # other common Python testing frameworks include pytest and nose + # https://pytest.org + # https://nose.readthedocs.io - run: + name: run tests command: | . venv/bin/activate - python manage.py test + # python manage.py test + echo 'A benign message' + - store_artifacts: - path: test-reports/ - destination: tr1 - - store_test_results: - path: test-reports/ - - add_ssh_keys: - fingerprints: - - "48:a0:87:54:ca:75:32:12:c6:9e:a2:77:a4:7a:08:a4" - - deploy: - name: Deploy Master to Heroku - command: | - if [ "${CIRCLE_BRANCH}" == "master" ]; then - git push heroku master - heroku run python manage.py deploy - heroku restart - fi + path: test-reports + destination: test-reports + \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8aaceaa2..6d491b50 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ nosetests.xml venv .env +.vscode \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3f19399b..ca31ef92 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,5 @@ # use requirements/dev.txt for local development and testing -r requirements/common.txt Flask-SSLify==0.1.5 -gunicorn==19.7.1 \ No newline at end of file +gunicorn==19.7.1 +xmlrunner==1.7.7 \ No newline at end of file