Cleanup travis (#425)

* reduce matrix size

* add debug info to test script

* fix install line

* fix conditional openssl install

* move -x param in bash scripts

* parallel travis tests

* make coverage parallel as well

* fixup kcov to build tests

* include resolver in macOS and beta/nightly builds

* fix kcov scripts to script

* add coverage for all features

* remove rustls and native-tls from build for kcov

* merge test runs by feature and run kcov after all linux stable

* add individual test for mdns
This commit is contained in:
Benjamin Fry 2018-04-28 11:17:54 -07:00 committed by GitHub
parent d855253a7f
commit 2e70f7aa4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 235 additions and 69 deletions

View File

@ -4,106 +4,148 @@ language: rust
matrix:
include:
# optional feature variations
# we want full coverage, include all features...
# parallel builds for tests
- rust: stable
env: OPTIONS="--all-features"
RUN_KCOV=1
env: NAME=all_features
RUST_BACKTRACE=full
script:
- scripts/test_all_features.sh
after_success:
- scripts/run_kcov.sh
# no features
# parallel builds for tests
- rust: stable
env: MODULES="client integration-tests proto resolver server"
OPTIONS="--no-default-features"
RUN_KCOV=1
env: NAME=default_features
RUST_BACKTRACE=full
script:
- scripts/test_default_features.sh
after_success:
- scripts/run_kcov.sh
# default features...
# parallel builds for tests
- rust: stable
env: MODULES="client integration-tests proto resolver server"
RUN_KCOV=1
env: NAME=dns_over_native_tls
RUST_BACKTRACE=full
script:
- scripts/test_dns_over_native_tls.sh
after_success:
- scripts/run_kcov.sh
# just openssl
# parallel builds for tests
- rust: stable
env: MODULES="client integration-tests proto resolver server"
OPTIONS="--no-default-features --features=dnssec-openssl"
RUN_KCOV=1
env: NAME=dns_over_openssl
RUST_BACKTRACE=full
script:
- scripts/test_dns_over_openssl.sh
after_success:
- scripts/run_kcov.sh
# just dns-over-openssl
# parallel builds for tests
- rust: stable
env: MODULES="resolver"
OPTIONS="--no-default-features --features=dns-over-openssl"
RUN_KCOV=1
env: NAME=dns_over_rustls
RUST_BACKTRACE=full
script:
- scripts/test_dns_over_rustls.sh
after_success:
- scripts/run_kcov.sh
# just ring
# parallel builds for tests
- rust: stable
env: MODULES="client integration-tests proto resolver server"
OPTIONS="--no-default-features --features=dnssec-ring"
RUN_KCOV=1
env: NAME=dnssec_openssl
RUST_BACKTRACE=full
script:
- scripts/test_dnssec_openssl.sh
after_success:
- scripts/run_kcov.sh
# just dns-over-rustls
# parallel builds for tests
- rust: stable
env: MODULES="resolver"
OPTIONS="--no-default-features --features=dns-over-rustls"
RUN_KCOV=1
env: NAME=dnssec_ring
RUST_BACKTRACE=full
script:
- scripts/test_dnssec_ring.sh
after_success:
- scripts/run_kcov.sh
# just dns-over-native-tls
# parallel builds for tests
- rust: stable
env: MODULES="resolver"
OPTIONS="--no-default-features --features=dns-over-native-tls"
RUN_KCOV=1
env: NAME=mdns
RUST_BACKTRACE=full
script:
- scripts/test_mdns.sh
after_success:
- scripts/run_kcov.sh
# just tls using openssl
# parallel builds for tests
- rust: stable
env: MODULES="integration-tests server"
OPTIONS="--no-default-features --features=dns-over-openssl"
RUN_KCOV=1
env: NAME=no_default_features
RUST_BACKTRACE=full
script:
- scripts/test_no_default_features.sh
after_success:
- scripts/run_kcov.sh
# min rust version
# - rust: 1.14.0
- rust: beta
env: RUST_BACKTRACE=full
env: NAME=beta
RUST_BACKTRACE=full
script:
- scripts/test_all_features.sh
# macos
- os: osx
rust: stable
env: OPTIONS="--all-features"
env: NAME=macOS
RUST_BACKTRACE=full
script:
- scripts/test_all_features.sh
# nightly
- rust: nightly
env: NAME=nightly
RUST_BACKTRACE=full
script:
- scripts/test_all_features.sh
# clippy
- rust: nightly
env: NAME=clippy
RUST_BACKTRACE=full
before_install:
- cargo install clippy --force
script:
- scripts/run_clippy.sh
- rust: nightly
env: RUST_BACKTRACE=full
- rust: nightly
env: CLIPPY=true
RUST_BACKTRACE=full
- rust: nightly
env: RUSTFMT=true
env: NAME=rustfmt
RUST_BACKTRACE=full
before_install:
- cargo install rustfmt-nightly --force
script:
- cargo fmt --all -- --write-mode=diff
# compatiblity tests
- rust: stable
env: MODULES="compatibility-tests"
env: NAME=compatiblity
TDNS_BIND_PATH="../../bind-9.11.0-P1/bin/named/named"
OPTIONS="--no-default-features --features=bind"
RUST_BACKTRACE=full
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/install_openssl_deb.sh; fi
- scripts/install_bind.sh
script:
- cargo test --manifest-path compatibility-tests/Cargo.toml --no-default-features --features=bind
after_success:
- scripts/run_kcov.sh
allow_failures:
- rust: nightly
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/install_openssl_deb.sh ; fi
- if [[ "$MODULES" == "compatibility-tests" ]]; then scripts/install_bind.sh ; fi
- if [[ "$RUSTFMT" == "true" ]]; then cargo install rustfmt-nightly --force ; fi
- if [[ "$CLIPPY" == "true" ]]; then cargo install clippy --force; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/install_openssl_deb.sh; fi
## All scripts are run above...
script:
- bash -c 'if [ -z ${CLIPPY+x} ] && [ -z ${RUSTFMT+x} ] ; then scripts/run_tests.sh ; fi'
- bash -c 'if [[ "$CLIPPY" == "true" ]] ; then scripts/run_clippy.sh ; fi'
- bash -c 'if [[ "$RUSTFMT" == "true" ]] ; then cargo fmt --all -- --write-mode=diff; fi'
after_success: scripts/run_kcov.sh
- fail
#after_success: scripts/run_kcov.sh

View File

@ -1,5 +1,7 @@
#!/bin/bash -e
set -x
# This script is used for CI and assumes clippy is installed already.
# TODO: run clippy on the other crates, for now we only fixed the clippy warning on the client crate

View File

@ -1,5 +1,10 @@
#!/bin/bash -e
set -x
# THIS SCRIPT ASSUMES TESTS HAVE ALREADY BEEN BUILT
# *WARING* it is destructive and installs kcov via sudo!
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
@ -11,7 +16,6 @@ esac
# don't run on nightly or beta
rustc --version | grep beta && exit 0;
rustc --version | grep nightly && exit 0;
if [ -z ${RUN_KCOV} ] ; then exit 0; fi
rm -rf kcov-master master.tar.gz*

View File

@ -1,18 +1,18 @@
#!/bin/bash -e
MODULES=${MODULES:-"client integration-tests native-tls openssl proto resolver rustls server"}
CLIENT_OPTIONS=${CLIENT_OPTIONS} # add in all features
OPTIONS=${OPTIONS}
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
cd $trust_dns_dir
for i in ${MODULES:?}; do
pushd $i
opts=${OPTIONS}
if [ $i == "client" ] ; then opts="${OPTIONS} ${CLIENT_OPTIONS}" ; fi
echo "executing $i: cargo test ${opts} $@"
cargo test ${opts} $@
popd
done
# Enumerates all tests and feature variations for each module
scripts/test_all_features.sh
scripts/test_default_features.sh
scripts/test_dns_over_native_tls.sh
scripts/test_dns_over_openssl.sh
scripts/test_dns_over_rustls.sh
scripts/test_dnssec_openssl.sh
scripts/test_dnssec_ring.sh
scripts/test_mdns.sh
scripts/test_no_default_features.sh

17
scripts/test_all_features.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash -e
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
# Build all tests
cargo test --manifest-path proto/Cargo.toml --all-features
cargo test --manifest-path client/Cargo.toml --all-features
cargo test --manifest-path util/Cargo.toml --all-features
cargo test --manifest-path native-tls/Cargo.toml --all-features
cargo test --manifest-path openssl/Cargo.toml --all-features
cargo test --manifest-path rustls/Cargo.toml --all-features
cargo test --manifest-path resolver/Cargo.toml --all-features
cargo test --manifest-path server/Cargo.toml --all-features
cargo test --manifest-path integration-tests/Cargo.toml --all-features

View File

@ -0,0 +1,17 @@
#!/bin/bash -e
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
# Build all tests
cargo test --manifest-path proto/Cargo.toml
cargo test --manifest-path client/Cargo.toml
cargo test --manifest-path util/Cargo.toml
cargo test --manifest-path native-tls/Cargo.toml
cargo test --manifest-path openssl/Cargo.toml
cargo test --manifest-path rustls/Cargo.toml
cargo test --manifest-path resolver/Cargo.toml
cargo test --manifest-path server/Cargo.toml
cargo test --manifest-path integration-tests/Cargo.toml

View File

@ -0,0 +1,9 @@
#!/bin/bash -e
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
# Build all tests
cargo test --manifest-path resolver/Cargo.toml --features dns-over-native-tls

View File

@ -0,0 +1,11 @@
#!/bin/bash -e
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
# Build all tests
cargo test --manifest-path resolver/Cargo.toml --features dns-over-openssl
cargo test --manifest-path server/Cargo.toml --features dns-over-openssl
cargo test --manifest-path integration-tests/Cargo.toml --features dns-over-openssl

View File

@ -0,0 +1,9 @@
#!/bin/bash -e
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
# Build all tests
cargo test --manifest-path resolver/Cargo.toml --features dns-over-rustls

13
scripts/test_dnssec_openssl.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash -e
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
# Build all tests
cargo test --manifest-path proto/Cargo.toml --features dnssec-openssl
cargo test --manifest-path client/Cargo.toml --features dnssec-openssl
cargo test --manifest-path resolver/Cargo.toml --features dnssec-openssl
cargo test --manifest-path server/Cargo.toml --features dnssec-openssl
cargo test --manifest-path integration-tests/Cargo.toml --features dnssec-openssl

13
scripts/test_dnssec_ring.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash -e
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
# Build all tests
cargo test --manifest-path proto/Cargo.toml --features dnssec-ring
cargo test --manifest-path client/Cargo.toml --features dnssec-ring
cargo test --manifest-path resolver/Cargo.toml --features dnssec-ring
cargo test --manifest-path server/Cargo.toml --features dnssec-ring
cargo test --manifest-path integration-tests/Cargo.toml --features dnssec-ring

12
scripts/test_mdns.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash -e
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
# Build all tests
cargo test --manifest-path proto/Cargo.toml --features mdns
cargo test --manifest-path client/Cargo.toml --features mdns
cargo test --manifest-path resolver/Cargo.toml --features mdns
cargo test --manifest-path integration-tests/Cargo.toml --features mdns

View File

@ -0,0 +1,17 @@
#!/bin/bash -e
set -x
trust_dns_dir=$(dirname $0)/..
cd ${trust_dns_dir:?}
# Build all tests
cargo test --manifest-path proto/Cargo.toml --no-default-features
cargo test --manifest-path client/Cargo.toml --no-default-features
cargo test --manifest-path util/Cargo.toml --no-default-features
cargo test --manifest-path native-tls/Cargo.toml --no-default-features
cargo test --manifest-path openssl/Cargo.toml --no-default-features
cargo test --manifest-path rustls/Cargo.toml --no-default-features
cargo test --manifest-path resolver/Cargo.toml --no-default-features
cargo test --manifest-path server/Cargo.toml --no-default-features
cargo test --manifest-path integration-tests/Cargo.toml --no-default-features