diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4a246ec --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +Dockerfile +.dockerignore diff --git a/.travis.yml b/.travis.yml index aa1dfb3..6a86b1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,30 @@ language: c sudo: required dist: trusty + before_install: - # update package list - - sudo apt-get update -qq - - git clone https://anonscm.debian.org/git/collab-maint/britney2-tests.git britney2-tests - - git clone https://anonscm.debian.org/git/collab-maint/britney-tests-live-data.git britney2-tests/live-data + - git clone https://salsa.debian.org/debian/britney2-tests.git britney2-tests + - git clone https://salsa.debian.org/debian/britney-tests-live-data.git britney2-tests/live-data - rm -f .coverage install: - # install build dependencies - - sudo apt-get install -qq --no-install-recommends python3 python3-apt python3-yaml python3-coverage python3-nose rsync libclass-accessor-perl + # Update docker-engine using Ubuntu 'trusty' apt repo + - sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + - > + echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | + sudo tee -a /etc/apt/sources.list + - sudo apt-get update + - > + sudo apt-get -o Dpkg::Options::="--force-confdef" \ + -o Dpkg::Options::="--force-confold" --assume-yes install docker-engine + - docker version + + - docker pull debian:stable + - docker build --tag=britney . script: - - nosetests3 -v --with-coverage - - britney2-tests/bin/runtests ./ci/britney-coverage.sh britney2-tests/t test-out - - britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data -after_success: - - python3-coverage report - - python3-coverage report -m - - python3-coverage xml -i - - bash <(curl -s https://codecov.io/bash) + # https://docs.codecov.io/docs/testing-with-docker + - ci_env=$(bash <(curl -s https://codecov.io/env)) ; docker run $ci_env britney /bin/sh -c "export CI=true ; ci/run-everything-and-upload-to-codecov.io.sh" + #notifications: # email: false diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3790899 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM debian:stable +WORKDIR /britney +ADD . /britney +RUN apt-get update && apt-get install --no-install-recommends --assume-yes python3 python3-apt python3-yaml python3-coverage python3-nose rsync libclass-accessor-perl libdpkg-perl curl diff --git a/ci/run-everything-and-upload-to-codecov.io.sh b/ci/run-everything-and-upload-to-codecov.io.sh new file mode 100755 index 0000000..13de507 --- /dev/null +++ b/ci/run-everything-and-upload-to-codecov.io.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +set -e + +err=0 + +nosetests3 -v --with-coverage || err=$? +echo +echo +britney2-tests/bin/runtests ./ci/britney-coverage.sh britney2-tests/t test-out || err=$? +echo +echo +if [ -n "$CI" ] ; then + echo skipping live-2011-12-13 to prevent time out on Travis of the whole test suite +else + britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-1 live-2011-12-13 || err=$? +fi +echo +britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-2 live-2011-12-20 || err=$? +echo +britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-3 live-2012-01-04 || err=$? +echo +britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-4 live-2012-05-09 || err=$? +echo +britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-5 live-2016-04-11 || err=$? +echo + +if [ $err = 0 ] ; then + python3-coverage report || true + echo + python3-coverage report -m || true + echo + python3-coverage xml -i || true + echo + bash <(curl -s https://codecov.io/bash) || true +fi + +exit $err