From 5c61cc9881f721a7475c32e324aaa92ef44bb3e7 Mon Sep 17 00:00:00 2001 From: Michael Roytman Date: Tue, 11 Apr 2017 11:27:35 -0400 Subject: [PATCH 1/4] update travis.yml file to use notifier Docker image --- .travis.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0326278..083be39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,23 @@ language: python python: - "2.7" + +sudo: required +services: + - docker + +cache: + - pip + +before_install: + - docker-compose -f ./.travis-docker-compose.yml up -d + install: - - pip install -r requirements.txt - - pip install coveralls + - docker exec -t notifier_testing bash -c 'pip install -r /edx/app/notifier/notifier/requirements.txt' script: - - python manage.py test notifier + - docker exec -t notifier_testing bash -c 'cd /edx/app/notifier/notifier && coverage run /edx/app/notifier/notifier/manage.py test notifier' + after_success: - - coveralls + - pip install -U codecov + - docker exec notifier_testing /edx/app/notifier/notifier/run_coverage.sh + - codecov From 1fc45447bea8a886f8d146b847db50c49d10d38d Mon Sep 17 00:00:00 2001 From: Michael Roytman Date: Tue, 11 Apr 2017 11:27:48 -0400 Subject: [PATCH 2/4] add docker-compose file for travis --- .travis-docker-compose.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .travis-docker-compose.yml diff --git a/.travis-docker-compose.yml b/.travis-docker-compose.yml new file mode 100644 index 0000000..7314b05 --- /dev/null +++ b/.travis-docker-compose.yml @@ -0,0 +1,13 @@ +version: '2' + +services: + edxops-notifier: + image: edxops/notifier:latest + container_name: notifier_testing + volumes: + - .:/edx/app/notifier/notifier + # The docker container produced from configuration.git does not currently + # run and expose a port for notifier. This means that we need to run some + # command that keeps the notifier container alive while we run tests on it. + # We have not yet standardized on an init replacement which could be used instead. + command: tail -f /dev/null From 09040e6747b78701374dd82327c523eb544d5186 Mon Sep 17 00:00:00 2001 From: Michael Roytman Date: Tue, 11 Apr 2017 15:19:13 -0400 Subject: [PATCH 3/4] add run_coverage script --- run_coverage.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 run_coverage.sh diff --git a/run_coverage.sh b/run_coverage.sh new file mode 100755 index 0000000..bceb51f --- /dev/null +++ b/run_coverage.sh @@ -0,0 +1,4 @@ +#!/bin/bash -xe +. /edx/app/notifier/virtualenvs/notifier/bin/activate +cd /edx/app/notifier/notifier +coverage xml From 98b1d13a14317808189b90dccc9ff53f6ecef01b Mon Sep 17 00:00:00 2001 From: Michael Roytman Date: Wed, 12 Apr 2017 14:18:58 -0400 Subject: [PATCH 4/4] fixup .coveragerc --- .coveragerc | 1 + 1 file changed, 1 insertion(+) diff --git a/.coveragerc b/.coveragerc index 8d7c45d..9a3145c 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,4 @@ [run] branch = True source = . +data_file = .coverage