Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368575 )

Change subject: build: Add Travis CI and Codecov configuration
......................................................................

build: Add Travis CI and Codecov configuration

* Update karma-chrome-launcher to 2.2.0 which adds support for
  `chromium --headless`. This makes tests easier and faster to run,
  without windows popping up in the background of the terminal.

  It also makes the tests run faster and more reliable by not being subject
  to changes in behaviour as result of not being the foreground window
  (e.g. throttled timeout/UI/CPU handling, lack of focus/blur events).

* Add Travis CI build configuration.
  - No need to add the traditional DISPLAY+Xvfb hack to .travis.yml
    given that this is not needed for Haedless Chrome.

  - Move Firefox from the standard 'grunt test' run to the
    'grunt ci' run. This means during local development tests will
    run once in one (default) browser (instead of two).
    But on merge (gate-and-submitt) we still run against two
    local browsers + various remote browsers in SauceLabs.

* Add Codecov integration. We have our coverage reports on
  doc.wikimedia.org, but this is not discoverable by tools that
  statically analyse npm packages. Publishing it on a site like
  Code Climate, Coveralls, or Codecov makes it discoverable and
  also has the benefit of providing other useful integrations
  and features. This improves our Quality and Maintenance scores
  on sites like npms.io.

Change-Id: I1ae6df57747553043f2ebf8b35329820d08c5072
---
A .travis.yml
M Gruntfile.js
M package.json
3 files changed, 20 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/core refs/changes/75/368575/1

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..06b1b6a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,13 @@
+sudo: false
+dist: trusty
+language: node_js
+
+node_js:
+ - "6"
+
+addons:
+  chrome: stable
+
+after_success:
+ - npm install -g [email protected]
+ - codecov
diff --git a/Gruntfile.js b/Gruntfile.js
index fa2ff43..ae64640 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -136,7 +136,7 @@
                        },
                        // Primary unit test run (includes code coverage)
                        main: {
-                               browsers: [ 'Chrome' ],
+                               browsers: [ 'ChromeHeadless' ],
                                preprocessors: {
                                        'dist/*.js': [ 'coverage' ]
                                },
@@ -154,12 +154,13 @@
                                remapIstanbulReporter: {
                                        reports: {
                                                'text-summary': null,
-                                               html: 'coverage/'
+                                               html: 'coverage/',
+                                               lcovonly: 'coverage/lcov.info'
                                        }
                                }
                        },
                        jquery: {
-                               browsers: [ 'Chrome' ],
+                               browsers: [ 'ChromeHeadless' ],
                                options: {
                                        files: [
                                                
'node_modules/jquery/dist/jquery.js',
@@ -197,8 +198,8 @@
        } );
 
        grunt.registerTask( 'build', [ 'clean', 'concat:oojs', 'concat:jquery', 
'copy:dist', 'uglify' ] );
-       grunt.registerTask( '_test', [ 'git-build', 'clean', 'concat:test', 
'concat:jquery', 'eslint:dev', 'karma:main', 'karma:jquery', 'karma:other' ] );
-       grunt.registerTask( 'ci', [ '_test', 'karma:ci' ] );
+       grunt.registerTask( '_test', [ 'git-build', 'clean', 'concat:test', 
'concat:jquery', 'eslint:dev', 'karma:main', 'karma:jquery' ] );
+       grunt.registerTask( 'ci', [ '_test', 'karma:other', 'karma:ci' ] );
 
        if ( process.env.ZUUL_PIPELINE === 'gate-and-submit' ) {
                grunt.registerTask( 'test', 'ci' );
diff --git a/package.json b/package.json
index b24f37b..23c2c24 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
     "grunt-karma": "2.0.0",
     "jquery": "3.2.1",
     "karma": "1.5.0",
-    "karma-chrome-launcher": "2.0.0",
+    "karma-chrome-launcher": "2.2.0",
     "karma-coverage": "1.1.1",
     "karma-firefox-launcher": "1.0.1",
     "karma-qunit": "1.2.1",

-- 
To view, visit https://gerrit.wikimedia.org/r/368575
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ae6df57747553043f2ebf8b35329820d08c5072
Gerrit-PatchSet: 1
Gerrit-Project: oojs/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to