From b0826346a64e58b81e00ec6fcb0d2b75b302c0d3 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 27 Feb 2019 07:51:52 -0500 Subject: [PATCH 1/6] Travis: control "make check" with its own flag Previously we had "make check" launched whenever DISTCHECK was false. Now we'd like to turn it off in a few other circumstances, like running chutney. Maybe stem too? --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 456b5abc56..a6727923d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ matrix: ## We run coverage with hardening off, which seems like enough # - env: HARDENING_OPTIONS="" ## We check asciidoc with distcheck, to make sure we remove doc products - - env: DISTCHECK="yes" ASCIIDOC_OPTIONS="" + - env: DISTCHECK="yes" ASCIIDOC_OPTIONS="" SKIP_MAKE_CHECK="yes" ## Uncomment to allow the build to report success (with non-required ## sub-builds continuing to run) if all required sub-builds have @@ -153,7 +153,7 @@ script: - echo "Configure flags are $CONFIGURE_FLAGS" - ./configure $CONFIGURE_FLAGS ## We run `make check` because that's what https://jenkins.torproject.org does. - - if [[ "$DISTCHECK" == "" ]]; then make check; fi + - if [[ "$SKIP_MAKE_CHECK" == "" ]]; then make check; fi - if [[ "$DISTCHECK" != "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS"; fi ## If this build was one that produced coverage, upload it. - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p' || echo "Coverage failed"; fi @@ -163,7 +163,7 @@ after_failure: ## But the log is too long for travis' rendered view, so tail it. - tail -1000 config.log || echo "tail failed" ## `make check` will leave a log file with more details of test failures. - - if [[ "$DISTCHECK" == "" ]]; then cat test-suite.log || echo "cat failed"; fi + - if [[ "$SKIP_MAKE_CHECK" == "" ]]; then cat test-suite.log || echo "cat failed"; fi ## `make distcheck` puts it somewhere different. - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog || echo "make failed"; fi From 63325c05964ca5906aad4b51a53a5dc471fc7347 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 27 Feb 2019 07:59:39 -0500 Subject: [PATCH 2/6] Add a chutney mode to travis.yml. --- .travis.yml | 8 +++++++- changes/chutney_ci | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changes/chutney_ci diff --git a/.travis.yml b/.travis.yml index a6727923d0..a8ad1f122f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,10 @@ matrix: # - env: HARDENING_OPTIONS="" ## We check asciidoc with distcheck, to make sure we remove doc products - env: DISTCHECK="yes" ASCIIDOC_OPTIONS="" SKIP_MAKE_CHECK="yes" + # We also try running a hardened clang build with chutney on Linux. + - env: CHUTNEY="yes" SKIP_MAKE_CHECK="yes" CHUTNEY_ALLOW_FAILURES="2" + compiler: clang + os: linux ## Uncomment to allow the build to report success (with non-required ## sub-builds continuing to run) if all required sub-builds have @@ -142,7 +146,8 @@ install: - if [[ "$COVERAGE_OPTIONS" != "" ]]; then pip install --user cpp-coveralls; fi ## If we're on OSX, and using asciidoc, configure asciidoc - if [[ "$ASCIIDOC_OPTIONS" == "" ]] && [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export XML_CATALOG_FILES="/usr/local/etc/xml/catalog"; fi - ## + ## If we're running chutney, install it. + - if [[ "$CHUTNEY" != "" ]]; then git clone --depth 1 https://github.com/torproject/chutney.git ; export CHUTNEY_PATH="$(pwd)/chutney"; fi ## Finally, list installed package versions - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then dpkg-query --show; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list --versions; fi @@ -155,6 +160,7 @@ script: ## We run `make check` because that's what https://jenkins.torproject.org does. - if [[ "$SKIP_MAKE_CHECK" == "" ]]; then make check; fi - if [[ "$DISTCHECK" != "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS"; fi + - if [[ "$CHUTNEY" != "" ]]; then make test-network-all; fi ## If this build was one that produced coverage, upload it. - if [[ "$COVERAGE_OPTIONS" != "" ]]; then coveralls -b . --exclude src/test --exclude src/trunnel --gcov-options '\-p' || echo "Coverage failed"; fi diff --git a/changes/chutney_ci b/changes/chutney_ci new file mode 100644 index 0000000000..b17d587329 --- /dev/null +++ b/changes/chutney_ci @@ -0,0 +1,3 @@ + o Minor features (continuous integration): + - Our Travis configuration now uses Chutney to run some network + integration tests automatically. Closes ticket 29280. From b26e3e4c565f4f764ee13a8afd5ea569547bc402 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 1 Jul 2019 14:05:26 +1000 Subject: [PATCH 3/6] Travis: show chutney logs on chutney job failure Part of 29280. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a8ad1f122f..cb1351a18e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -172,6 +172,7 @@ after_failure: - if [[ "$SKIP_MAKE_CHECK" == "" ]]; then cat test-suite.log || echo "cat failed"; fi ## `make distcheck` puts it somewhere different. - if [[ "$DISTCHECK" != "" ]]; then make show-distdir-testlog || echo "make failed"; fi + - if [[ "$CHUTNEY" != "" ]]; then ls test_network_log || echo "ls failed"; cat test_network_log/* || echo "cat failed"; fi before_cache: ## Delete all gcov files. From ac7ce179834d8d97342fc17bc385730eccc109a8 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 1 Jul 2019 14:10:07 +1000 Subject: [PATCH 4/6] Travis: show the chutney commit and python version Part of 29280. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index cb1351a18e..562036e51e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -151,6 +151,10 @@ install: ## Finally, list installed package versions - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then dpkg-query --show; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list --versions; fi + ## Get python version + - python --version + ## If we're running chutney, show the chutney commit + - if [[ "$CHUTNEY" != "" ]]; then pushd "$CHUTNEY_PATH"; git log -1 ; popd ; fi script: - ./autogen.sh From 75f9ae9029b4244658042ce7a4243202bfb4c527 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 1 Jul 2019 14:11:25 +1000 Subject: [PATCH 5/6] Travis: remove a redundant os: linux line Linux is the first item in the os matrix, so we don't need to specify it under matrix: include: . Part of 29280. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 562036e51e..190f43bd01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,6 @@ matrix: # We also try running a hardened clang build with chutney on Linux. - env: CHUTNEY="yes" SKIP_MAKE_CHECK="yes" CHUTNEY_ALLOW_FAILURES="2" compiler: clang - os: linux ## Uncomment to allow the build to report success (with non-required ## sub-builds continuing to run) if all required sub-builds have From 6bc8dedbed31abc40ca3017ac4f26a3373eac40d Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 1 Jul 2019 14:33:54 +1000 Subject: [PATCH 6/6] Travis: SKIP_MAKE_CHECK="yes" when running stem And add some comments about stem Part of 29280. --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8493589f7c..66d39f69cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,7 +53,7 @@ matrix: - env: CHUTNEY="yes" SKIP_MAKE_CHECK="yes" CHUTNEY_ALLOW_FAILURES="2" compiler: clang # We clone our stem repo and run `make test-stem` - - env: TEST_STEM="yes" + - env: TEST_STEM="yes" SKIP_MAKE_CHECK="yes" ## Check rust online with distcheck, to make sure we remove rust products - env: DISTCHECK="yes" RUST_OPTIONS="--enable-rust --enable-cargo-online-mode" ## Check disable module dirauth with and without rust @@ -75,7 +75,7 @@ matrix: ## https://docs.travis-ci.com/user/customizing-the-build#matching-jobs-with-allow_failures allow_failures: ## test-stem sometimes hangs on Travis - - env: TEST_STEM="yes" + - env: TEST_STEM="yes" SKIP_MAKE_CHECK="yes" exclude: ## gcc on OSX is less useful, because the default compiler is clang. @@ -178,6 +178,7 @@ install: - if [[ "$TOR_RUST_DEPENDENCIES" == "true" ]]; then export TOR_RUST_DEPENDENCIES=$PWD/src/ext/rust/crates; fi ## If we're running chutney, install it. - if [[ "$CHUTNEY" != "" ]]; then git clone --depth 1 https://github.com/torproject/chutney.git ; export CHUTNEY_PATH="$(pwd)/chutney"; fi + ## If we're running stem, install it. - if [[ "$TEST_STEM" != "" ]]; then git clone --depth 1 https://github.com/torproject/stem.git ; export STEM_SOURCE_DIR=`pwd`/stem; fi ## ## Finally, list installed package versions @@ -194,6 +195,7 @@ install: - python --version ## If we're running chutney, show the chutney commit - if [[ "$CHUTNEY" != "" ]]; then pushd "$CHUTNEY_PATH"; git log -1 ; popd ; fi + ## If we're running stem, show the stem version and commit - if [[ "$TEST_STEM" != "" ]]; then pushd stem; python -c "from stem import stem; print(stem.__version__);"; git log -1; popd; fi script: