Skip to content

Commit

Permalink
Separate test logic
Browse files Browse the repository at this point in the history
Move integration test into individual stage and allow failure for it.

Related to #45
  • Loading branch information
li-boxuan committed Aug 3, 2018
1 parent 1f88cfa commit 3638063
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
35 changes: 26 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,37 @@ cache:
directories:
- "node_modules"

.disable_global: &disable_global
after_success: false
after_failure: false
deploy: false

.integration: &integration
<<: *disable_global
stage: integration
# Needed for Firefox
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
script: script/run-integration-test.sh

# env forces jobs to be created from the top level settings
env:
jobs:
include:
- stage: moban
- <<: *disable_global
stage: moban
language: python
python: 3.6
cache: pip
before_install: false
install: pip install moban
before_script: false
script: .ci/check_moban.sh
after_success: false
deploy: false

# Needed for Firefox
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3 # give xvfb some time to start
- *integration
allow_failures:
- *integration

before_install:
- npm install --no-save --no-optional --only=dev [email protected]
Expand All @@ -39,6 +50,12 @@ script:
- script/build.sh
- npm run test

after_success:
- codecov

after_failure:
- codecov

notifications:
email: false
webhooks: https://www.travisbuddy.com/
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,10 @@
},
"engines": {
"npm": "~5.8.0"
},
"ava": {
"files": [
"test/integration/**.js"
]
}
}
5 changes: 5 additions & 0 deletions script/run-integration-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e -x

# Set the flag `--race` to kill all tasks when a task finished with zero.
$(npm bin)/run-p --race "start-selenium" "serve" "build-and-test"
3 changes: 0 additions & 3 deletions script/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ do
done

$(npm bin)/jest

# Set the flag `--race` to kill all tasks when a task finished with zero.
$(npm bin)/run-p --race "start-selenium" "serve" "build-and-test"
File renamed without changes.

0 comments on commit 3638063

Please sign in to comment.