Commit 13687648 authored by Arthur Verschaeve's avatar Arthur Verschaeve

Merge pull request #1212 from samccone/sjs/test-work

CI Test work
parents d42bf75d 75f6a685
...@@ -8,11 +8,13 @@ node_js: ...@@ -8,11 +8,13 @@ node_js:
- '0.12' - '0.12'
notifications: notifications:
irc: 'irc.freenode.org#tastejs' irc: 'irc.freenode.org#tastejs'
branches: addons:
only: sauce_connect: true
- master
env: env:
# add in tokens for sauce labs
global: global:
- secure: gd7Y1sZyUc4+eck+c4cZ19WdVkmvvfE16fegUMZ9/BMRVYaaEfLZ/805+mOPccAebu5nuGKX0dAjXBwDGcAk2T9YvXpgl8GHu5sAHT3ax0XTibwW7Je2ayf8dJqTO9eRelY616v2mYUlj9QMmbWCB2zESsscY3hi2DQAPeueMdo=
- secure: av1hgfvD9UpQr59Q2qcyC0WmiUvRivJHzdcrwj3uYiIJLxxpXv00EC4PzqMZAVREOaQEK1s9FwFVSYn8FbvtvWp5TnWNvSXUXCSjc+I0MYhxbtvcAuKlDzayHSfp17bt0BY3pxB/1BdwMdPwDYumEULphKOmsLr4ocsJCfng2Ds=
# GH_OAUTH_TOKEN is the oauth token generated as described at # GH_OAUTH_TOKEN is the oauth token generated as described at
# https://help.github.com/articles/creating-an-oauth-token-for-command-line-use # https://help.github.com/articles/creating-an-oauth-token-for-command-line-use
# #
...@@ -31,20 +33,9 @@ env: ...@@ -31,20 +33,9 @@ env:
before_script: before_script:
# install dependencies # install dependencies
- npm install -g gulp - npm install -g gulp
- python -m SimpleHTTPServer &
- sleep 2
script: script:
# We want to gate on passing tests and a successful build # We want to gate on passing tests and a successful build
- gulp - gulp
after_success: - ./travis-runner.sh
# Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token
- git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} site > /dev/null 2>&1
- cd site
- if git checkout gh-pages; then git checkout -b gh-pages; fi
- git rm -r .
- cp -R ../dist/* .
- cp ../dist/.* .
- git add -f .
- git config user.email 'travis@rdrei.net'
- git config user.name 'TasteBot'
- git commit -am 'update the build files for gh-pages [ci skip]'
# Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token
- git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages > /dev/null 2>&1
...@@ -63,7 +63,9 @@ list = list.filter(function (framework) { ...@@ -63,7 +63,9 @@ list = list.filter(function (framework) {
// if a specific framework has been named, just run this one // if a specific framework has been named, just run this one
if (argv.framework) { if (argv.framework) {
list = list.filter(function (framework) { list = list.filter(function (framework) {
return framework.name === argv.framework; return [].concat(argv.framework).some(function (f) {
return f === framework.name;
});
}); });
if (list.length === 0) { if (list.length === 0) {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"mocha-known-issues-reporter": "git+https://github.com/ColinEberhardt/mocha-known-issues-reporter.git#v0.0.0", "mocha-known-issues-reporter": "git+https://github.com/ColinEberhardt/mocha-known-issues-reporter.git#v0.0.0",
"optimist": "^0.6.1", "optimist": "^0.6.1",
"q": "^1.0.1", "q": "^1.0.1",
"selenium-webdriver": "^2.42.1" "selenium-webdriver": "^2.45.1"
}, },
"scripts": { "scripts": {
"serve": "http-server -p 8000 ..", "serve": "http-server -p 8000 ..",
......
...@@ -21,9 +21,31 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod ...@@ -21,9 +21,31 @@ module.exports.todoMVCTest = function (frameworkName, baseUrl, speedMode, laxMod
} }
function launchBrowser() { function launchBrowser() {
browser = new webdriver.Builder()
.withCapabilities({browserName : browserName}) if (process.env.SAUCE_USERNAME !== undefined) {
.build(); browser = new webdriver.Builder()
.usingServer(
'http://' +
process.env.SAUCE_USERNAME +
':' +
process.env.SAUCE_ACCESS_KEY +
'@ondemand.saucelabs.com:80/wd/hub'
)
.withCapabilities({
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
build: process.env.TRAVIS_BUILD_NUMBER,
browserName: browserName,
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY
})
.build();
} else {
browser = new webdriver.Builder()
.withCapabilities({
browserName: browserName
})
.build();
}
browser.get(baseUrl); browser.get(baseUrl);
......
#!/bin/bash
set -o pipefail
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]
then
git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} site > /dev/null 2>&1
cd site
if git checkout gh-pages; then git checkout -b gh-pages; fi
git rm -r .
cp -R ../dist/* .
cp ../dist/.* .
git add -f .
git config user.email 'travis@rdrei.net'
git config user.name 'TasteBot'
git commit -am 'update the build files for gh-pages [ci skip]'
# Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token
git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages > /dev/null 2>&1
else
git remote add current https://github.com/tastejs/todomvc.git && \
git fetch current && \
cd browser-tests/ && \
npm i && \
git diff HEAD current/master --name-only | awk 'BEGIN {FS = "/"}; {print $1 "/" $2 "/" $3}' | uniq | grep -v \/\/ | grep examples | awk -F '[/]' '{print "--framework=" $2}' | xargs npm run test --
exit $?
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment