Skip to content

Commit c5f8555

Browse files
majectysgkim126
authored andcommitted
Separate integration tests from unit tests in the .travis.yml file
Make Travis build success even if integration tests fail. But Slack notification will be delivered after integration tests fail.
1 parent 824551e commit c5f8555

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

.travis.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,45 @@ stages:
99
jobs:
1010
include:
1111
- stage: test
12-
name: osx
12+
name: test-osx
1313
os: osx
1414
install:
1515
- rustup toolchain install nightly-2018-07-17
1616
- rustup component add rustfmt-preview --toolchain nightly-2018-07-17
17-
- npm install -g yarn
1817
before_script:
1918
- cargo fetch --verbose
2019
script:
2120
- cargo +nightly-2018-07-17 fmt -- --check && RUST_BACKTRACE=1 cargo test --verbose --all
22-
- cargo build && cd test && yarn && yarn start
23-
- name: linux
21+
- name: test-linux
2422
os: linux
2523
sudo: required
2624
install:
2725
- rustup toolchain install nightly-2018-07-17
2826
- rustup component add rustfmt-preview --toolchain nightly-2018-07-17
29-
- npm install -g yarn
3027
before_script:
3128
- cargo fetch --verbose
3229
script:
3330
- cargo +nightly-2018-07-17 fmt -- --check && RUST_BACKTRACE=1 cargo test --verbose --all
31+
- name: test-int-linux
32+
os: linux
33+
install:
34+
- nvm install 8
35+
- nvm use 8
36+
- npm install -g yarn
37+
script:
38+
- cargo build && cd test && yarn && yarn start
39+
after_failure:
40+
- "curl -X POST -H 'Content-type: application/json' --data '{\"text\":\"Fail integration test in linux https://travis-ci.org/'$TRAVIS_REPO_SLUG'/builds/'$TRAVIS_BUILD_ID'\"}' $SLACK_WEBHOOK_URL"
41+
- name: test-int-osx
42+
os: osx
43+
install:
44+
- nvm install 8
45+
- nvm use 8
46+
- npm install -g yarn
47+
script:
3448
- cargo build && cd test && yarn && yarn start
49+
after_failure:
50+
- "curl -X POST -H 'Content-type: application/json' --data '{\"text\":\"Fail integration test in osx https://travis-ci.org/'$TRAVIS_REPO_SLUG'/builds/'$TRAVIS_BUILD_ID'\"}' $SLACK_WEBHOOK_URL"
3551
- stage: deploy
3652
name: deploy
3753
sudo: required
@@ -43,6 +59,9 @@ jobs:
4359
script: bash docker_push.sh
4460
on:
4561
branch: docker-build
62+
allow_failures:
63+
- name: test-int-linux
64+
- name: test-int-osx
4665
notifications:
4766
webhooks: https://webhooks.gitter.im/e/71bb03cf9abce5b02c43
4867
cache: cargo

0 commit comments

Comments
 (0)