ci: use sudo: false
on Travis (#21641)
Related to #21422. PR Close #21641
This commit is contained in:
parent
e9f1d44015
commit
0dacf6d5f1
@ -30,8 +30,14 @@ module.exports = function (config) {
|
|||||||
colors: true,
|
colors: true,
|
||||||
logLevel: config.LOG_INFO,
|
logLevel: config.LOG_INFO,
|
||||||
autoWatch: true,
|
autoWatch: true,
|
||||||
browsers: ['Chrome'],
|
browsers: ['CustomChrome'],
|
||||||
browserNoActivityTimeout: 60000,
|
browserNoActivityTimeout: 60000,
|
||||||
singleRun: false
|
singleRun: false,
|
||||||
|
customLaunchers: {
|
||||||
|
CustomChrome: {
|
||||||
|
base: 'Chrome',
|
||||||
|
flags: process.env.TRAVIS && ['--no-sandbox']
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -12,7 +12,8 @@ exports.config = {
|
|||||||
browserName: 'chrome',
|
browserName: 'chrome',
|
||||||
// For Travis
|
// For Travis
|
||||||
chromeOptions: {
|
chromeOptions: {
|
||||||
binary: process.env.CHROME_BIN
|
binary: process.env.CHROME_BIN,
|
||||||
|
args: ['--no-sandbox']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
directConnect: true,
|
directConnect: true,
|
||||||
|
@ -17,11 +17,14 @@ const printer = require('lighthouse/lighthouse-cli/printer');
|
|||||||
const config = require('lighthouse/lighthouse-core/config/default.js');
|
const config = require('lighthouse/lighthouse-core/config/default.js');
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
|
const CHROME_LAUNCH_OPTS = {};
|
||||||
const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer/';
|
const VIEWER_URL = 'https://googlechrome.github.io/lighthouse/viewer/';
|
||||||
|
|
||||||
// Specify the path to Chrome on Travis
|
|
||||||
|
// Specify the path and flags for Chrome on Travis
|
||||||
if (process.env.TRAVIS) {
|
if (process.env.TRAVIS) {
|
||||||
process.env.LIGHTHOUSE_CHROMIUM_PATH = process.env.CHROME_BIN;
|
process.env.LIGHTHOUSE_CHROMIUM_PATH = process.env.CHROME_BIN;
|
||||||
|
CHROME_LAUNCH_OPTS.chromeFlags = ['--no-sandbox'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run
|
// Run
|
||||||
@ -71,7 +74,7 @@ function ignoreHttpsAudits(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function launchChromeAndRunLighthouse(url, flags, config) {
|
function launchChromeAndRunLighthouse(url, flags, config) {
|
||||||
return chromeLauncher.launch().then(chrome => {
|
return chromeLauncher.launch(CHROME_LAUNCH_OPTS).then(chrome => {
|
||||||
flags.port = chrome.port;
|
flags.port = chrome.port;
|
||||||
return lighthouse(url, flags, config).
|
return lighthouse(url, flags, config).
|
||||||
then(results => chrome.kill().then(() => results)).
|
then(results => chrome.kill().then(() => results)).
|
||||||
|
@ -23,7 +23,8 @@ exports.config = {
|
|||||||
'browserName': 'chrome',
|
'browserName': 'chrome',
|
||||||
// For Travis
|
// For Travis
|
||||||
chromeOptions: {
|
chromeOptions: {
|
||||||
binary: process.env.CHROME_BIN
|
binary: process.env.CHROME_BIN,
|
||||||
|
args: ['--no-sandbox']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user