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

Change subject: [WIP] Additional integration test features for cindy
......................................................................

[WIP] Additional integration test features for cindy

WIP because the full integration with the barry script to automate
running hasn't been finished, so there is probably still more to do.

* Cindy didn't like that we were using npm dependencies that
 weren't explicitly called out. Perhaps due to a difference in
 npm version of something. Regardless it's good practice to call
 out our dependencies explicitly.
* Add a --tag=... option to request only specific tags are run.
 This can, for example, specify an or of tags with '@foo or @bar'.
 All tests except those marked frozen can be selected with "not
 @frozen". See cucumber-tag-expressions lib for more details.
* Add a configuration file specifically for mwv in labs that generates
 appropriate urls. Triggered by setting MWV_LABS_HOSTNAME environment
 variable to the hostname of the machine. ex:
 MWV_LABS_HOTSNAME=cirrus-browser-bot
* Increase max parallelism of chrome to 8. This will still be limited
 by the top level maxInstances to 1 by default (necessary when mixing
 frozen index tests with the others).
* Add a grunt cli parameter to set parallelism from the command line.

Change-Id: I4d8837b2c56b018f682429756a2ba6efd106969d
---
M Gruntfile.js
M package.json
M tests/integration/config/wdio.conf.js
A tests/integration/config/wdio.conf.mwvlabs.js
A tests/integration/log/.gitkeep
5 files changed, 50 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/35/397735/1

diff --git a/Gruntfile.js b/Gruntfile.js
index b3841f7..16637ca 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -19,6 +19,8 @@
 
        if ( process.env.JENKINS_HOME ) {
                WebdriverIOconfigFile = 
'./tests/integration/config/wdio.conf.jenkins.js';
+       } else if ( process.env.MWV_LABS_HOSTNAME ) {
+               WebdriverIOconfigFile = 
'./tests/integration/config/wdio.conf.mwvlabs.js';
        } else {
                WebdriverIOconfigFile = 
'./tests/integration/config/wdio.conf.js';
        }
@@ -59,6 +61,15 @@
                webdriver: {
                        test: {
                                configFile: WebdriverIOconfigFile,
+                               cucumberOpts: {
+                                       tagExpression: ( () => {
+                                               return grunt.option( 'tags' );
+                                       )()
+                               },
+                               maxInstances: ( () => {
+                                       let max = grunt.option( 'maxInstances' 
);
+                                       return max ? parseInt( max, 10 ) : 1;
+                               } )(),
                                spec: ( () => {
                                        let spec = grunt.option( 'spec' );
                                        if ( !spec ) {
diff --git a/package.json b/package.json
index cf4a6b3..b6855f5 100644
--- a/package.json
+++ b/package.json
@@ -8,8 +8,10 @@
     "selenium": "killall -0 chromedriver 2>/dev/null || chromedriver 
--url-base=/wd/hub --port=4444 & grunt webdriver:test; killall chromedriver"
   },
   "devDependencies": {
+    "bluebird": "3.5.1",
     "chai": "^4.1.2",
     "cucumber": "^3.0.1",
+    "deepmerge": "2.0.1",
     "grunt": "1.0.1",
     "grunt-banana-checker": "0.5.0",
     "grunt-contrib-jshint": "1.0.0",
@@ -21,8 +23,11 @@
     "stylelint-config-wikimedia": "0.4.1",
     "wdio-cucumber-framework": "^1.0.1",
     "webdriverio": "^4.8.0",
+    "wdio-spec-reporter": "1.2.0",
+    "wdio-junit-reporter": "1.1.3",
     "restify": "^6.3.4",
     "request": "^2.83.0",
-    "request-promise-native": "^1.0.5"
+    "request-promise-native": "^1.0.5",
+    "semlog": "0.6.10"
   }
 }
diff --git a/tests/integration/config/wdio.conf.js 
b/tests/integration/config/wdio.conf.js
index 82601f7..89bb9a3 100644
--- a/tests/integration/config/wdio.conf.js
+++ b/tests/integration/config/wdio.conf.js
@@ -124,7 +124,7 @@
                // maxInstances can get overwritten per capability. So if you 
have an in-house Selenium
                // grid with only 5 firefox instances available you can make 
sure that not more than
                // 5 instances get started at a time.
-               maxInstances: 1,
+               maxInstances: 8,
                //
                browserName: 'chrome',
                // Since Chrome v57 
https://bugs.chromium.org/p/chromedriver/issues/detail?id=1625
diff --git a/tests/integration/config/wdio.conf.mwvlabs.js 
b/tests/integration/config/wdio.conf.mwvlabs.js
new file mode 100644
index 0000000..7b3a7a7
--- /dev/null
+++ b/tests/integration/config/wdio.conf.mwvlabs.js
@@ -0,0 +1,32 @@
+/*jshint esversion: 6,  node:true */
+
+/* eslint no-undef: "error" */
+/* eslint-env node */
+'use strict';
+var merge = require( 'deepmerge' ),
+       wdioConf = require( './wdio.conf.js' );
+
+// Overwrite default settings
+exports.config = merge( wdioConf.config, {
+       reporters: [ 'dot', 'junit' ],
+       reporterOptions: {
+               junit: {
+                       outputDir: __dirname + '/../log'
+               }
+       },
+       wikis: {
+               cirrustest: {
+                       apiUrl: 'http://cirrustest-' + 
process.env.MWV_LABS_HOSTNAME + '.wmflabs.org/w/api.php',
+                       baseUrl: 'http://cirrustest-' + 
process.env.MWV_LABS_HOSTNAME + '.wmflabs.org',
+               },
+               commons: {
+                       apiUrl: 'http://commons-' + 
process.env.MWV_LABS_HOSTNAME + '.wmflabs.org/w/api.php',
+                       baseUrl: 'http://commons-' + 
process.env.MWV_LABS_HOSTNAME + '.wmflabs.org',
+               },
+               ru: {
+                       apiUrl: 'http://ru-' + process.env.MWV_LABS_HOSTNAME + 
'.wmflabs.org/w/api.php',
+                       baseUrl: 'http://ru-' + process.env.MWV_LABS_HOSTNAME + 
'.wmflabs.org',
+               },
+       }
+// overwrite so new reporters override previous instead of merging into 
combined reporters
+}, { arrayMerge: ( dest, source, opt ) => source } );
diff --git a/tests/integration/log/.gitkeep b/tests/integration/log/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/integration/log/.gitkeep

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d8837b2c56b018f682429756a2ba6efd106969d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to