Skip to content

Commit 0c71c2d

Browse files
committed
Merge before and script
Signed-off-by: Ana Hobden <operator@hoverbear.org>
1 parent 751995b commit 0c71c2d

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

.travis.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ env:
1313
global:
1414
- RUST_BACKTRACE=1
1515
- RUSTFLAGS="-D warnings"
16-
- PD_ADDR="127.0.0.1:2379"
17-
- TIKV_ADDR="127.0.0.1:2378"
1816

1917
install:
2018
- if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then rustup component add rustfmt; fi
@@ -23,20 +21,16 @@ install:
2321
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then choco install cmake; fi
2422
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then export PATH="$PATH:/c/Go/bin/:/c/Program Files/CMake/bin"; fi
2523

26-
27-
before_script:
24+
script:
2825
- if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo fmt -- --check; fi
29-
# Currently some crates have lint errors if clippy checks them.
3026
- if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo clippy -- -D clippy::all; fi
31-
32-
script:
3327
- cargo test --all -- --nocapture
34-
# We need to switch the daemon of Windows to use Linux docker containers.
35-
- if [[ $TRAVIS_OS_NAME == "windows" ]]; then "/c/Program Files/Docker/Docker/DockerCli.exe" -SwitchDaemon .; fi
36-
# OS X can't do docker on travis. :(
37-
- if [[ $TRAVIS_OS_NAME != "osx" ]]; then docker run -d --net=host --name pd --rm pingcap/pd --name "pd" --data-dir "pd" --client-urls "http://127.0.0.1:2379" --advertise-client-urls "http://127.0.0.1:2379"; fi
38-
- if [[ $TRAVIS_OS_NAME != "osx" ]]; then docker run -d --net=host --name kv --rm --ulimit nofile=90000:90000 pingcap/tikv --pd-endpoints "127.0.0.1:2379" --addr "127.0.0.1:2378" --data-dir "kv"; fi
39-
- if [[ $TRAVIS_OS_NAME != "osx" ]]; then docker ps; fi
40-
- if [[ $TRAVIS_OS_NAME != "osx" ]]; then docker logs pd; fi
41-
- if [[ $TRAVIS_OS_NAME != "osx" ]]; then docker logs kv; fi
42-
- if [[ $TRAVIS_OS_NAME != "osx" ]]; then cargo test --all --features integration-tests -- --nocapture; fi
28+
# For now we only run full integration tests on Linux. Here's why:
29+
# * Docker on OS X is not supported by Travis.
30+
# * Docker on Windows seems to not have the correct binary at `"/c/Program Files/Docker/Docker/DockerCli.exe" to switch it to Linux containers.
31+
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker run -d --net=host --name pd --rm pingcap/pd --name "pd" --data-dir "pd" --client-urls "http://127.0.0.1:2379" --advertise-client-urls "http://127.0.0.1:2379"; fi
32+
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker run -d --net=host --name kv --rm --ulimit nofile=90000:90000 pingcap/tikv --pd-endpoints "127.0.0.1:2379" --addr "127.0.0.1:2378" --data-dir "kv"; fi
33+
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker ps; fi
34+
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker logs pd; fi
35+
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then docker logs kv; fi
36+
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then PD_ADDR="127.0.0.1:2379" cargo test --all --features integration-tests -- --nocapture; fi

0 commit comments

Comments
 (0)