From: Michał Gołębiowski-Owczarek Date: Mon, 19 Mar 2018 17:12:23 +0000 (+0100) Subject: Build: Don't require sudo on Travis, use sandboxless headless Chrome X-Git-Tag: 3.4.0~70 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b95e0da68e1e3fce59a6a54c209b893f611b0b9c;p=jquery.git Build: Don't require sudo on Travis, use sandboxless headless Chrome The Chrome sandbox doesn't work on Travis unless sudo is enabled. Instead, we're disabling the Chrome sandbox. Closes gh-4011 --- diff --git a/.travis.yml b/.travis.yml index 4ac42174e..4fa82ae7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,5 @@ language: node_js -# Temporary workaround. -# Karma can't access the binaries on travis -# without root access. -# See https://github.com/travis-ci/travis-ci/issues/8836 -sudo: required +sudo: false node_js: - "4" - "6" diff --git a/Gruntfile.js b/Gruntfile.js index a0e907715..fbf9b5671 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,7 +13,8 @@ module.exports = function( grunt ) { } var fs = require( "fs" ), - gzip = require( "gzip-js" ); + gzip = require( "gzip-js" ), + isTravis = process.env.TRAVIS; if ( !grunt.option( "filename" ) ) { grunt.option( "filename", "jquery.js" ); @@ -151,6 +152,12 @@ module.exports = function( grunt ) { options: { customContextFile: "test/karma.context.html", customDebugFile: "test/karma.debug.html", + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: "ChromeHeadless", + flags: [ "--no-sandbox" ] + } + }, frameworks: [ "qunit" ], middleware: [ "mockserver" ], plugins: [ @@ -214,7 +221,9 @@ module.exports = function( grunt ) { singleRun: true }, main: { - browsers: [ "ChromeHeadless" ] + + // The Chrome sandbox doesn't work on Travis. + browsers: [ isTravis ? "ChromeHeadlessNoSandbox" : "ChromeHeadless" ] }, // To debug tests with Karma: