Skip to content

Test #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 40 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ nosetests.xml
venv

.env
.vscode
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
gunicorn==19.7.1
xmlrunner==1.7.7