CI: Blade Runner → Karma Runner

This commit is contained in:
Javan Makhmali
2019-01-07 10:23:51 -05:00
parent eb236aa0c9
commit dc615d10c7
11 changed files with 2624 additions and 59 deletions
-23
View File
@@ -21,26 +21,3 @@ build:
require:
- sprockets/export
- sprockets/svgo
plugins:
sauce_labs:
tunnel_timeout: 120
test_config:
idle_timeout: 900
max_duration: 900
browsers:
Google Chrome:
version: -2
Firefox:
version: -2
Safari:
platform: Mac
version: -2
Microsoft Edge:
version: -2
Internet Explorer:
version: 11
iPhone:
version: [11.2, 10.3, 9.3]
Android:
version: [6.0, 5.1, 4.4]
+10 -6
View File
@@ -1,6 +1,10 @@
language: ruby
cache: bundler
script: travis_wait 25 bin/ci
branches:
only:
- master
dist: trusty
sudo: false
cache:
- bundler
- yarn
install:
- bundle install
- cd test && yarn install && cd -
script:
- bin/ci
-4
View File
@@ -9,10 +9,6 @@ gem 'coffee-script-source', '~> 1.9.1'
gem 'eco'
gem 'sass'
gem 'uglifier'
gem 'blade', '~> 0.7.0'
gem 'blade-sauce_labs_plugin', '~> 0.7.3'
gem 'selenium-webdriver', '~> 3.2.0'
gem 'github_api', '~> 0.13.1'
gem 'aws-sdk'
-15
View File
@@ -26,12 +26,6 @@ GEM
thor (~> 0.19.1)
useragent (~> 0.16.7)
blade-qunit_adapter (2.0.1)
blade-sauce_labs_plugin (0.7.3)
childprocess
faraday
selenium-webdriver
childprocess (0.7.0)
ffi (~> 1.0, >= 1.0.11)
coffee-script (2.4.1)
coffee-script-source
execjs
@@ -70,7 +64,6 @@ GEM
faye-websocket (0.10.5)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.5.1)
ffi (1.9.18)
github_api (0.13.1)
addressable (~> 2.4.0)
descendants_tracker (~> 0.0.4)
@@ -96,12 +89,7 @@ GEM
rack (>= 1.2, < 3)
rack (1.6.5)
rake (10.0.4)
rubyzip (1.2.1)
sass (3.4.3)
selenium-webdriver (3.2.2)
childprocess (~> 0.5)
rubyzip (~> 1.0)
websocket (~> 1.0)
sprockets (3.6.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@@ -119,7 +107,6 @@ GEM
execjs (>= 0.3.0)
json (>= 1.8.0)
useragent (0.16.8)
websocket (1.2.4)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
@@ -130,14 +117,12 @@ PLATFORMS
DEPENDENCIES
aws-sdk
blade (~> 0.7.0)
blade-sauce_labs_plugin (~> 0.7.3)
coffee-script
coffee-script-source (~> 1.9.1)
eco
github_api (~> 0.13.1)
rake
sass
selenium-webdriver (~> 3.2.0)
sprockets (= 3.6.0)
sprockets-export
sprockets-svgo
+2 -11
View File
@@ -4,18 +4,9 @@ set -e
if [ "$TRAVIS_REPO_SLUG" == "basecamp/trix" ] && [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
$(base64 --decode <<< ZXhwb3J0IFNBVUNFX1VTRVJOQU1FPWJhc2VjYW1wX3RyaXgK)
$(base64 --decode <<< ZXhwb3J0IFNBVUNFX0FDQ0VTU19LRVk9MjY3OGE4NzMtNzJmNC00NzU2LTkzYjUtZjFhOGUyZTc3ODIxCg==)
bin/blade ci
status=$?
if [ "$TRAVIS_TAG" != "" ]; then
bin/update-status-image
fi
exit $status
else
$(base64 --decode <<< ZXhwb3J0IFNBVUNFX1VTRVJOQU1FPWJhc2VjYW1wX3RyaXhfZGV2Cg==)
$(base64 --decode <<< ZXhwb3J0IFNBVUNFX0FDQ0VTU19LRVk9NTIzODNlNTItZTM4NC00MzZjLWFkMmUtMGZmNTcyNjIyNjc5Cg==)
export BUILD=""
bin/blade ci
fi
cd test && yarn test
+12
View File
@@ -0,0 +1,12 @@
load_paths:
- src
- vendor
- ../assets
- ../polyfills
- ../src
build:
logical_paths:
- trix.js
- test.js
path: dist
+2
View File
@@ -1 +1,3 @@
/dist
/node_modules
/tmp
+122
View File
@@ -0,0 +1,122 @@
const config = {
browsers: ["ChromeHeadless"],
frameworks: ["qunit"],
files: [
{ pattern: "dist/trix.js", watched: false },
{ pattern: "dist/test.js", watched: false },
{ pattern: "src/test_helpers/fixtures/*.png", watched: false, included: false, served: true }
],
proxies: {
"/test_helpers/fixtures/": "/base/src/test_helpers/fixtures/"
},
client: {
clearContext: false,
qunit: {
showUI: true
}
},
singleRun: true,
autoWatch: false,
captureTimeout: 240000,
browserDisconnectTimeout: 240000,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 300000,
}
if (process.env.CI) {
config.customLaunchers = {
sl_chrome_latest: {
base: "SauceLabs",
browserName: "chrome",
version: "71"
},
sl_firefox_latest: {
base: "SauceLabs",
browserName: "firefox",
version: "64"
},
sl_safari_previous: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 10.12",
version: "11.0"
},
sl_safari_latest: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 10.13",
version: "12.0"
},
sl_edge_previous: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "17.17134"
},
sl_edge_latest: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "18.17763"
},
sl_ie_11: {
base: "SauceLabs",
browserName: "internet explorer",
platform: "Windows 8.1",
version: "11"
},
sl_ios_previous: {
base: "SauceLabs",
browserName: "safari",
platform: "ios",
device: "iPhone Simulator",
version: "11.3"
},
sl_ios_latest: {
base: "SauceLabs",
browserName: "safari",
platform: "ios",
device: "iPhone Simulator",
version: "12.0"
},
sl_android_previous: {
base: "SauceLabs",
browserName: "chrome",
platform: "android",
device: "Android Emulator",
version: "6.0"
},
sl_android_latest: {
base: "SauceLabs",
browserName: "chrome",
platform: "android",
device: "Android GoogleAPI Emulator",
version: "7.1"
}
}
config.browsers = Object.keys(config.customLaunchers)
config.reporters = ["dots", "saucelabs"]
config.sauceLabs = {
testName: "Trix",
retryLimit: 3,
idleTimeout: 600,
commandTimeout: 600,
maxDuration: 900,
build: buildId(),
}
function buildId() {
const { TRAVIS_BUILD_NUMBER, TRAVIS_BUILD_ID } = process.env
return TRAVIS_BUILD_NUMBER && TRAVIS_BUILD_ID
? `TRAVIS #${TRAVIS_BUILD_NUMBER} (${TRAVIS_BUILD_ID})`
: ""
}
}
module.exports = function(karmaConfig) {
karmaConfig.set(config)
}
+16
View File
@@ -0,0 +1,16 @@
{
"name": "trix-tests",
"version": "1.0.0",
"license": "MIT",
"private": true,
"dependencies": {
"karma": "^3.1.4",
"karma-chrome-launcher": "^2.2.0",
"karma-qunit": "^2.1.0",
"karma-sauce-launcher": "^2.0.2",
"qunit": "2.4.1"
},
"scripts": {
"test": "bundle exec blade build && karma start"
}
}
+2
View File
@@ -4,6 +4,8 @@
#= require_tree ./unit
Trix.config.undoInterval = 0
QUnit.config.hidepassed = true
QUnit.config.testTimeout = 20000
document.head.insertAdjacentHTML "beforeend", """
+2458
View File
File diff suppressed because it is too large Load Diff