Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test workflow, bis #4252

Merged
merged 27 commits into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
17018eb
Replace branches list
ogonkov Jan 21, 2022
52f2381
Add workflows to paths
ogonkov Jan 21, 2022
a2f7cba
Fix env vars
ogonkov Jan 21, 2022
02c3b73
Remove cache key for now
ogonkov Jan 21, 2022
8e97503
Remove xvfb setup
ogonkov Jan 21, 2022
0ab0d02
Add job names
ogonkov Jan 21, 2022
010e928
Split command
ogonkov Jan 21, 2022
a2cefce
Include test directory as a condition for running the test workflow
jgonggrijp Jan 22, 2022
453bdf5
Use GH default env vars directly in karma.conf-sauce (#4251)
jgonggrijp Jan 22, 2022
4e66def
Add a package-lock.json (#4251 #4246)
jgonggrijp Jan 22, 2022
a10ce93
Put back the test workflow cache key (#4251)
jgonggrijp Jan 22, 2022
f80570a
Run the test workflow in a newer Node version (#4251)
jgonggrijp Jan 22, 2022
b715738
Update Sauce browser selection in karma config (#4251)
jgonggrijp Jan 22, 2022
6f1eb88
Copy two Karma config fields from Underscore (#4251)
jgonggrijp Jan 22, 2022
c86aab2
Limit Karma Sauce concurrency (#4251)
jgonggrijp Jan 22, 2022
e71ee8f
Set the Karma Sauce region to 'eu' (#4251)
jgonggrijp Jan 22, 2022
91b190b
Run SauceLabs Firefox 11 tests specifically on Windows 10 (#4251)
jgonggrijp Jan 22, 2022
725a957
Restore env var indirection in Karma Sauce config (#4251)
jgonggrijp Jan 22, 2022
2694bfa
Increase Karma Sauce browserDisconnectTimeout (#4251)
jgonggrijp Jan 22, 2022
dddfba2
Upgrade the devDependencies (#4251 fix #4246)
jgonggrijp Jan 22, 2022
19ce298
Address linter errors and warnings (#4251 #4246)
jgonggrijp Jan 22, 2022
0e4ee91
Run npm audit fix (#4246)
jgonggrijp Jan 22, 2022
aef9972
Omit Firefox 11 from CI tests for now (#4251 #4252)
jgonggrijp Jan 23, 2022
a2002e8
Run latest Edge and Safari CI tests on latest OS versions (#4251)
jgonggrijp Jan 23, 2022
ac5e173
Use npm ci instead of npm install (#4252)
jgonggrijp Feb 11, 2022
ddc6ab8
Speed up Sauce testing (#4251 #4252)
jgonggrijp Feb 18, 2022
777279c
Just skip the browsers that don't work in Sauce Labs (#4252 #4253)
jgonggrijp Feb 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"dot-notation": [2, { "allowKeywords": false }],
"eol-last": 2,
"eqeqeq": [2, "smart"],
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": 2}],
"indent": [2, 2, {
"MemberExpression": 0,
"SwitchCase": 1,
"VariableDeclarator": 2
}],
"key-spacing": 1,
"keyword-spacing": [2, { "after": true }],
"linebreak-style": 2,
Expand Down Expand Up @@ -76,7 +80,7 @@
"no-unused-expressions": [2, {"allowTernary": true, "allowShortCircuit": true}],
"no-with": 2,
"object-curly-spacing": [2, "never"],
"quote-props": [1, "consistent-as-needed"],
"quote-props": [1, "consistent-as-needed", {"keywords": true}],
"quotes": [2, "single", "avoid-escape"],
"radix": 2,
"semi": 2,
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ name: Test
on:
push:
branches:
- ${{ github.event.repository.default_branch }}
- master
pull_request:
branches:
- ${{ github.event.repository.default_branch }}
- master
paths:
- '.github/workflows/**'
- 'test/**'
- '*.js'
- 'package.json'

Expand All @@ -22,18 +24,16 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 6
node-version: 14
cache: 'npm'
- run: npm install --no-audit && npm install --no-audit karma-cli karma-sauce-launcher
- name: Setup Sauce Labs
run: sh -e /etc/init.d/xvfb start
env:
DISPLAY: ':99.0'
- run: npm test
- run: ./node_modules/.bin/karma start karma.conf-sauce.js
- name: Install dependencies
run: |
npm ci
npm install --no-audit karma-cli karma-sauce-launcher
- name: Test
run: npm test
- name: Test in Sauce Labs
run: BUILD_NUMBER="$GITHUB_RUN_NUMBER" BUILD_ID="$GITHUB_RUN_ID" JOB_NUMBER="$GITHUB_JOB" ./node_modules/.bin/karma start karma.conf-sauce.js
env:
SAUCE_USERNAME: ${{ secrets.SauceUsername }}
SAUCE_ACCESS_KEY: ${{ secrets.SauceAccessKey }}
BUILD_NUMBER: ${{ GITHUB_RUN_NUMBER }}
BUILD_ID: ${{ GITHUB_RUN_ID }}
JOB_NUMBER: ${{ GITHUB_JOB }}
20 changes: 10 additions & 10 deletions backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -1625,11 +1625,11 @@

// Map from CRUD to HTTP for our default `Backbone.sync` implementation.
var methodMap = {
create: 'POST',
update: 'PUT',
patch: 'PATCH',
delete: 'DELETE',
read: 'GET'
'create': 'POST',
'update': 'PUT',
'patch': 'PATCH',
'delete': 'DELETE',
'read': 'GET'
};

// Set the default implementation of `Backbone.ajax` to proxy through to `$`.
Expand Down Expand Up @@ -1722,11 +1722,11 @@
// against the current location hash.
_routeToRegExp: function(route) {
route = route.replace(escapeRegExp, '\\$&')
.replace(optionalParam, '(?:$1)?')
.replace(namedParam, function(match, optional) {
return optional ? match : '([^/?]+)';
})
.replace(splatParam, '([^?]*?)');
.replace(optionalParam, '(?:$1)?')
.replace(namedParam, function(match, optional) {
return optional ? match : '([^/?]+)';
})
.replace(splatParam, '([^?]*?)');
return new RegExp('^' + route + '(?:\\?([\\s\\S]*))?$');
},

Expand Down
61 changes: 32 additions & 29 deletions karma.conf-sauce.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,36 @@ var _ = require('underscore');

// Browsers to run on Sauce Labs platforms
var sauceBrowsers = _.reduce([
['firefox', '35'],
['firefox', '30'],
['firefox', '21'],
['firefox', '11'],
['firefox', '4'],
['firefox', 'latest'],
['firefox', '60'],
['firefox', '40'],
// TODO: find a way to get testing on old Firefox to work. (#4253)
// ['firefox', '11'],

['chrome', '40'],
['chrome', '39'],
['chrome', '31'],
['chrome', '26'],
['chrome', 'latest'],
['chrome', '60'],
// TODO: these versions of Chrome fail with a mysterious
// "_T_ is not defined" (#4253)
// ['chrome', '40'],
// ['chrome', '26'],

['microsoftedge', '20.10240', 'Windows 10'],
['internet explorer', '11', 'Windows 10'],
['internet explorer', '10', 'Windows 8'],
['internet explorer', '9', 'Windows 7'],
// latest Edge as well as pre-Blink versions
['microsoftedge', 'latest', 'Windows 11'],
['microsoftedge', '18', 'Windows 10'],
['microsoftedge', '13', 'Windows 10'],

['opera', '12'],
['opera', '11'],
['internet explorer', 'latest', 'Windows 10'],
// TODO: these versions of IE run 50 out of 425 tests, then hang for unknown
// reasons. (#4253)
// ['internet explorer', '10', 'Windows 8'],
// ['internet explorer', '9', 'Windows 7'],
// Older versions of IE no longer supported by Sauce Labs

['android', '5'],
['android', '4.4'],
['safari', 'latest', 'macOS 12'],
['safari', '12', 'macOS 10.14'],
['safari', '11', 'macOS 10.13'],
['safari', '8', 'OS X 10.10'],

// 4.3 currently erros with some router tests
// ['android', '4.3'],

['android', '4.0'],

['safari', '8.0', 'OS X 10.10'],
['safari', '7'],
['safari', '6'],
['safari', '5']
], function(memo, platform) {
// internet explorer -> ie
var label = platform[0].split(' ');
Expand Down Expand Up @@ -60,6 +59,9 @@ module.exports = function(config) {
basePath: '',
frameworks: ['qunit'],
singleRun: true,
browserDisconnectTimeout: 60000,
browserDisconnectTolerance: 2,
browserNoActivityTimeout: 60000,

// list of files / patterns to load in the browser
files: [
Expand All @@ -72,7 +74,7 @@ module.exports = function(config) {
],

// Number of sauce tests to start in parallel
concurrency: 9,
concurrency: 4,

// test results reporter to use
reporters: ['dots', 'saucelabs'],
Expand All @@ -82,10 +84,11 @@ module.exports = function(config) {
sauceLabs: {
build: 'GH #' + process.env.BUILD_NUMBER + ' (' + process.env.BUILD_ID + ')',
startConnect: true,
tunnelIdentifier: process.env.JOB_NUMBER
tunnelIdentifier: process.env.JOB_NUMBER,
region: 'eu'
},

captureTimeout: 120000,
captureTimeout: 60000,
customLaunchers: sauceBrowsers,

// Browsers to launch, commented out to prevent karma from starting
Expand Down
Loading