Skip to content

Commit

Permalink
Merge 9982bae into f2fc1da
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte authored Jun 20, 2018
2 parents f2fc1da + 9982bae commit 8821769
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 34 deletions.
43 changes: 21 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,42 @@ addons:
firefox: latest
chrome: stable

before_script:
- npm install -g bower polymer-cli@next
- bower install

env:
- POLYMER=2
- POLYMER=2 TEST_SUITE=unit_tests
- POLYMER=2 TEST_SUITE=visual_tests
- POLYMER=3

script:
- if [[ "$POLYMER" = "2" ]]; then
npm install &&
npm -q i && npm i -q --no-save bower polymer-cli && bower -q i &&
gulp lint version:check &&
polymer lint --rules polymer-2 --input ./src/*.html ./theme/**/*.html &&
if [[ "$TRAVIS_EVENT_TYPE" = "pull_request" ]]; then
xvfb-run -s '-screen 0 1024x768x24' polymer test;
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
if [[ "$TEST_SUITE" = "visual_tests" ]]; then
npm i -q --no-save gemini@^4.0.0 gemini-sauce gemini-polyserve &&
gemini test test/visual && gemini test test/visual -c .gemini-chrome.yml;
else
wct --env saucelabs;
fi;
else
polymer test --env saucelabs;
xvfb-run -s '-screen 0 1024x768x24' wct;
fi &&
if [[ "$TRAVIS_EVENT_TYPE" = "cron" && "$TEST_SUITE" = "unit_tests" ]]; then
wct --env saucelabs-cron;
fi;
fi

- if [[ "$POLYMER" = "3" ]]; then
npm install -g yarn magi-cli &&
(cd .. && git clone --depth 1 -b vaadin-components-next git://github.com/web-padawan/polymer-modulizer.git && cd polymer-modulizer && npm link) &&
npm --no-save -q install -g yarn bower magi-cli web-component-tester &&
(cd .. && git clone --depth 1 -b vaadin-components-rc git://github.com/web-padawan/polymer-modulizer.git && cd polymer-modulizer && npm -q link) &&
rm -rf node_modules &&
magi p3-convert --out . &&
magi p3-convert --out . --import-style=name &&
yarn install --flat &&
if [[ "$TRAVIS_EVENT_TYPE" = "pull_request" ]]; then
xvfb-run -s '-screen 0 1024x768x24' polymer test --module-resolution=node --npm;
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
wct --module-resolution=node --npm --env saucelabs;
else
polymer test --module-resolution=node --npm --env saucelabs;
xvfb-run -s '-screen 0 1024x768x24' wct --module-resolution=node --npm;
fi;
fi

- if [[ "$TRAVIS_EVENT_TYPE" = "cron" ]]; then
npm install &&
polymer test --env saucelabs-cron;
fi

after_success:
- cat ${TRAVIS_BUILD_DIR}/coverage/lcov.info | coveralls
- "cat ${TRAVIS_BUILD_DIR}/coverage/lcov.info | coveralls"
38 changes: 26 additions & 12 deletions wct.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var argv = require('yargs').argv;
var envIndex = process.argv.indexOf('--env') + 1;
var env = envIndex ? process.argv[envIndex] : undefined;

module.exports = {
plugins: {
Expand All @@ -11,31 +12,44 @@ module.exports = {
exclude: [],
thresholds: {
global: {
statements: 99
statements: 98
}
}
}
},

registerHooks: function(context) {
var saucelabsPlatforms = [
const saucelabsPlatformsMobile = [
'macOS 10.12/iphone@10.3',
'Windows 10/microsoftedge@15',
'Windows 10/internet explorer@11',
'macOS 10.12/safari@11.0',
'macOS 10.12/ipad@11.2',
'macOS 9.3.2/iphone@9.3'
];

var cronPlatforms = [
'macOS 10.12/ipad@11.0',
const saucelabsPlatformsMicrosoft = [
'Windows 10/microsoftedge@16',
'Windows 10/internet explorer@11'
];

const saucelabsPlatformsDesktop = [
'Windows 10/chrome@65',
'Windows 10/firefox@59',
'macOS 10.12/safari@11.0'
];

const saucelabsPlatforms = [
...saucelabsPlatformsMobile,
...saucelabsPlatformsMicrosoft,
...saucelabsPlatformsDesktop
];

const cronPlatforms = [
'Android/chrome',
'Windows 10/chrome@65',
'Windows 10/firefox@59'
];

if (argv.env === 'saucelabs') {
if (env === 'saucelabs') {
context.options.plugins.sauce.browsers = saucelabsPlatforms;

} else if (argv.env === 'saucelabs-cron') {
} else if (env === 'saucelabs-cron') {
context.options.plugins.sauce.browsers = cronPlatforms;
}
}
Expand Down

0 comments on commit 8821769

Please sign in to comment.