Skip to content

Commit

Permalink
Added integration tests with rust-cookbook to Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
budziq committed May 14, 2018
1 parent 737fd5e commit 178276c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ language: rust

matrix:
include:
# integration tests with rust-cookbook
- os: linux
rust: stable
env: INTEGRATION_TESTS=1

# skeptic unit tests
- os: linux
rust: stable
- os: linux
Expand Down
22 changes: 20 additions & 2 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex

main() {
main_tests() {
# remove clean once fixed https://github.com/budziq/rust-skeptic/issues/57
cargo clean
cargo build
Expand All @@ -20,7 +20,25 @@ main() {
cargo test --release
}

test_rust_cookbook() {
# clone and checkout an arbitrary commit that we know to be ok but complex
echo "Rust Cookbook integration tests!"
cd ..
rm -rf rust-cookbook || true
git clone https://github.com/rust-lang-nursery/rust-cookbook.git
cd rust-cookbook
git checkout f8c48a096f18acc224004af0a4ce83e9997cbd80
sed -ie 's|skeptic.*|skeptic = { path = "../rust-skeptic/src/skeptic"}|g' ./Cargo.toml
cargo test
}

# we don't run the "test phase" when doing deploys
if [ -z $TRAVIS_TAG ]; then
main

if [[ "${INTEGRATION_TESTS:-}" == 1 ]]; then
test_rust_cookbook
else
main_tests
fi

fi

0 comments on commit 178276c

Please sign in to comment.