From dbf024bf7a05913e74e417e19060f07042de16ea Mon Sep 17 00:00:00 2001 From: Paul Gevers Date: Tue, 13 Mar 2018 09:47:30 +0100 Subject: [PATCH 1/4] travis: Build Debian stable docker image and use it for testing --- .dockerignore | 2 ++ .travis.yml | 28 ++++++++------- Dockerfile | 4 +++ ci/run-everything-and-upload-to-codecov.io.sh | 34 +++++++++++++++++++ 4 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100755 ci/run-everything-and-upload-to-codecov.io.sh 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..2aedfa4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,29 @@ 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 - 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) + - docker run 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..8e00678 --- /dev/null +++ b/ci/run-everything-and-upload-to-codecov.io.sh @@ -0,0 +1,34 @@ +#!/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 +britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-1 live-2011-12-13 || err=$? +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 From bc735000023cb25ace6ada091ce066d04616bce6 Mon Sep 17 00:00:00 2001 From: Paul Gevers Date: Thu, 15 Mar 2018 10:29:23 +0100 Subject: [PATCH 2/4] tests: data has moved to salsa --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2aedfa4..2e89ebf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,8 @@ sudo: required dist: trusty before_install: - - 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: From 49cd47681b161bb44aadf1da7b1284fea5f83621 Mon Sep 17 00:00:00 2001 From: Paul Gevers Date: Thu, 15 Mar 2018 16:45:43 +0100 Subject: [PATCH 3/4] travis: Enable submission to codecov --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2e89ebf..6a86b1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,8 @@ install: - docker build --tag=britney . script: - - docker run britney /bin/sh -c "export CI=true ; ci/run-everything-and-upload-to-codecov.io.sh" + # 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 From 2e627f9be58a442d7fb02739cf5164f58c5be0a2 Mon Sep 17 00:00:00 2001 From: Paul Gevers Date: Thu, 15 Mar 2018 16:49:25 +0100 Subject: [PATCH 4/4] travis: Disable one live data test to prevent time outs --- ci/run-everything-and-upload-to-codecov.io.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci/run-everything-and-upload-to-codecov.io.sh b/ci/run-everything-and-upload-to-codecov.io.sh index 8e00678..13de507 100755 --- a/ci/run-everything-and-upload-to-codecov.io.sh +++ b/ci/run-everything-and-upload-to-codecov.io.sh @@ -10,7 +10,11 @@ echo britney2-tests/bin/runtests ./ci/britney-coverage.sh britney2-tests/t test-out || err=$? echo echo -britney2-tests/bin/runtests ./britney.py britney2-tests/live-data test-out-live-data-1 live-2011-12-13 || err=$? +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