From 5f01a90ce60b32b707a40ed0220c04ef5d8268b7 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Fri, 12 Jun 2015 18:14:33 +0000 Subject: [PATCH 1/3] Add simple Boulder integration test --- tests/boulder-integration.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 tests/boulder-integration.sh diff --git a/tests/boulder-integration.sh b/tests/boulder-integration.sh new file mode 100755 index 000000000..ed6428618 --- /dev/null +++ b/tests/boulder-integration.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Simple integration test, run as "./boulder-integration.sh auth" or +# adjust parameters: "./boulder-integration.sh --domain bang auth". + +root="$(mktemp -d)" + +# first three flags required, rest is handy defaults +letsencrypt \ + --server http://localhost:4000/acme/new-reg \ + --no-verify-ssl \ + --dvsni-port 5001 \ + --config-dir "$root/conf" \ + --work-dir "$root/work" \ + --text \ + --agree-tos \ + --email "" \ + --domains le.wtf \ + -vvvvvvv \ + "$@" + +# print at the end, so it's more visible +echo "\nRoot integration tests directory: $root" From 8bde250ff2835ec6294a3e1e1e1c99f59a05d7be Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 25 Jun 2015 08:25:10 +0000 Subject: [PATCH 2/3] boulder-integration.sh: agree-tos -> agree-eula, force standalone. --- tests/boulder-integration.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/boulder-integration.sh b/tests/boulder-integration.sh index ed6428618..2172d7e35 100755 --- a/tests/boulder-integration.sh +++ b/tests/boulder-integration.sh @@ -12,9 +12,10 @@ letsencrypt \ --config-dir "$root/conf" \ --work-dir "$root/work" \ --text \ - --agree-tos \ + --agree-eula \ --email "" \ --domains le.wtf \ + --authenticator standalone \ -vvvvvvv \ "$@" From e0bc6aeb50e714e3c8372c50e4521b14e2ca51ff Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 25 Jun 2015 08:26:02 +0000 Subject: [PATCH 3/3] Travis CI setup for integration testing (fixes #530). Candidate issues to be addressed: - race condition: start.sh might fail to start Boulder WFE before ./tests/boulder-integration.sh is run (unlikely, but possible, leading to flaky tests) - intertwined build logs (./start.sh boostraps in the background, integration test debug logs on server and client side) --- .travis.yml | 23 ++++++++++++++--------- tests/boulder-integration.sh | 13 ++++++------- tests/boulder-start.sh | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 16 deletions(-) create mode 100755 tests/boulder-start.sh diff --git a/.travis.yml b/.travis.yml index 167d6ad74..6e29702ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,19 +3,24 @@ language: python # http://docs.travis-ci.com/user/ci-environment/#CI-environment-OS before_install: travis_retry sudo ./bootstrap/ubuntu.sh -install: "travis_retry pip install tox coveralls" -script: "travis_retry tox" - -after_success: '[ "$TOXENV" == "cover" ] && coveralls' - # using separate envs with different TOXENVs creates 4x1 Travis build # matrix, which allows us to clearly distinguish which component under # test has failed env: - - TOXENV=py26 - - TOXENV=py27 - - TOXENV=lint - - TOXENV=cover + global: + - GOPATH=/tmp/go + matrix: + - TOXENV=py26 + - TOXENV=py27 + - TOXENV=lint + - TOXENV=cover + +install: "travis_retry pip install tox coveralls" +before_script: '[ "${TOXENV:0:2}" != "py" ] || ./tests/boulder-start.sh' +# TODO: eliminate substring slice bashism +script: 'travis_retry tox && ([ "${TOXENV:0:2}" != "py" ] || (source .tox/$TOXENV/bin/activate && ./tests/boulder-integration.sh))' + +after_success: '[ "$TOXENV" == "cover" ] && coveralls' notifications: email: false diff --git a/tests/boulder-integration.sh b/tests/boulder-integration.sh index 2172d7e35..adb6ab528 100755 --- a/tests/boulder-integration.sh +++ b/tests/boulder-integration.sh @@ -1,8 +1,10 @@ -#!/bin/sh -# Simple integration test, run as "./boulder-integration.sh auth" or -# adjust parameters: "./boulder-integration.sh --domain bang auth". +#!/bin/sh -xe +# Simple integration test, make sure to activate virtualenv beforehand +# (source venv/bin/activate) and that you are running Boulder test +# instance (see ./boulder-start.sh). root="$(mktemp -d)" +echo "\nRoot integration tests directory: $root" # first three flags required, rest is handy defaults letsencrypt \ @@ -17,7 +19,4 @@ letsencrypt \ --domains le.wtf \ --authenticator standalone \ -vvvvvvv \ - "$@" - -# print at the end, so it's more visible -echo "\nRoot integration tests directory: $root" + auth diff --git a/tests/boulder-start.sh b/tests/boulder-start.sh new file mode 100755 index 000000000..49139ff3c --- /dev/null +++ b/tests/boulder-start.sh @@ -0,0 +1,15 @@ +#!/bin/sh -xe +# Download and run Boulder instance for integration testing + +export GOPATH="${GOPATH:-/tmp/go}" + +# $ go get github.com/letsencrypt/boulder +# package github.com/letsencrypt/boulder +# imports github.com/letsencrypt/boulder +# imports github.com/letsencrypt/boulder: no buildable Go source files in /tmp/go/src/github.com/letsencrypt/boulder + +go get -d github.com/letsencrypt/boulder/cmd/boulder +cd $GOPATH/src/github.com/letsencrypt/boulder +make -j4 # Travis has 2 cores per build instance. +./start.sh & +# Hopefully start.sh bootstraps before integration test is started...