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

Change subject: [WIP] prepare replacement of selenium-CirrusSearch job
......................................................................

[WIP] prepare replacement of selenium-CirrusSearch job

Add a new config for running the smoke test on the beta cluster.
Added a small flag to disable all hooks.

Bug: T175179
Change-Id: I81afeb437f238dda0e7221953dd5cb745cea1062
---
M Gruntfile.js
M package.json
A tests/integration/config/wdio.conf.beta.smoke.js
D tests/integration/config/wdio.conf.jenkins.js
M tests/integration/config/wdio.conf.js
M tests/integration/features/support/hooks.js
M tests/integration/features/support/world.js
7 files changed, 41 insertions(+), 24 deletions(-)


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

diff --git a/Gruntfile.js b/Gruntfile.js
index b3841f7..c9323af 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -17,8 +17,8 @@
 
        var WebdriverIOconfigFile;
 
-       if ( process.env.JENKINS_HOME ) {
-               WebdriverIOconfigFile = 
'./tests/integration/config/wdio.conf.jenkins.js';
+       if ( process.env.CIRRUS_BETA_SMOKE_TEST ) {
+               WebdriverIOconfigFile = 
'./tests/integration/config/wdio.conf.beta.smoke.js';
        } else {
                WebdriverIOconfigFile = 
'./tests/integration/config/wdio.conf.js';
        }
diff --git a/package.json b/package.json
index cf4a6b3..e20472c 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
     "stylelint": "7.8.0",
     "stylelint-config-wikimedia": "0.4.1",
     "wdio-cucumber-framework": "^1.0.1",
+    "wdio-junit-reporter": "^0.3.1",
     "webdriverio": "^4.8.0",
     "restify": "^6.3.4",
     "request": "^2.83.0",
diff --git a/tests/integration/config/wdio.conf.beta.smoke.js 
b/tests/integration/config/wdio.conf.beta.smoke.js
new file mode 100644
index 0000000..26579d5
--- /dev/null
+++ b/tests/integration/config/wdio.conf.beta.smoke.js
@@ -0,0 +1,28 @@
+/*jshint esversion: 6,  node:true */
+
+/* eslint no-undef: "error" */
+/* eslint-env node */
+'use strict';
+const wdioConf = require( './wdio.conf.js' );
+
+// Overwrite default settings
+let config = wdioConf.config;
+
+config.disableHooks = true;
+config.wikis = {
+       default: 'beta',
+       beta: {
+               apiUrl: 'https://en.wikipedia.beta.wmflabs.org/w/api.php',
+               baseUrl: 'https://en.wikipedia.beta.wmflabs.org'
+       }
+};
+config.screenshotPath = '../log/';
+config.reporters = [ 'spec', 'junit' ];
+config.reporterOptions= {
+       junit: {
+               outputDir: '../log/'
+       }
+};
+config.specs = [ wdioConf.relPath( './integration/features/smoke.feature' ) ];
+
+exports.config = config;
diff --git a/tests/integration/config/wdio.conf.jenkins.js 
b/tests/integration/config/wdio.conf.jenkins.js
deleted file mode 100644
index 451b1c0..0000000
--- a/tests/integration/config/wdio.conf.jenkins.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*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, {
-       username: 'WikiAdmin',
-       password: 'testpass',
-       screenshotPath: '../log/',
-       baseUrl: process.env.MW_SERVER + process.env.MW_SCRIPT_PATH,
-
-       reporters: [ 'spec', 'junit' ],
-       reporterOptions: {
-               junit: {
-                       outputDir: '../log/'
-               }
-       }
-} );
diff --git a/tests/integration/config/wdio.conf.js 
b/tests/integration/config/wdio.conf.js
index 3f537ef..d61bf3b 100644
--- a/tests/integration/config/wdio.conf.js
+++ b/tests/integration/config/wdio.conf.js
@@ -14,6 +14,8 @@
        return path.resolve( __dirname, '../..', foo );
 }
 
+exports.relPath = relPath;
+
 let forkedTracker;
 let unixSocket;
 
@@ -36,6 +38,8 @@
        password: process.env.MEDIAWIKI_PASSWORD === undefined ?
                'vagrant' :
                process.env.MEDIAWIKI_PASSWORD,
+       // set to true to not perform any update on the target wiki
+       disableHooks: false,
        wikis: {
                default: 'cirrustest',
                cirrustest: {
diff --git a/tests/integration/features/support/hooks.js 
b/tests/integration/features/support/hooks.js
index 3f79285..7b7e8b0 100644
--- a/tests/integration/features/support/hooks.js
+++ b/tests/integration/features/support/hooks.js
@@ -11,6 +11,9 @@
 defineSupportCode( function( { After, Before } ) {
        const BeforeOnce = function ( options, fn ) {
                Before( options, Promise.coroutine( function* () {
+                       if ( this.config.disableHooks ) {
+                               return;
+                       }
                        const response = yield this.tags.check( options.tags );
                        if ( response  === 'complete' ) {
                                return;
diff --git a/tests/integration/features/support/world.js 
b/tests/integration/features/support/world.js
index 7b95499..b2a7897 100644
--- a/tests/integration/features/support/world.js
+++ b/tests/integration/features/support/world.js
@@ -96,6 +96,9 @@
 
        // Per-wiki api clients
        this.onWiki = function( wiki = this.config.wikis.default ) {
+               if ( this.config.disableHooks ) {
+                       return undefined;
+               }
                if ( apiClients[wiki] ) {
                        return apiClients[wiki];
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81afeb437f238dda0e7221953dd5cb745cea1062
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <dcau...@wikimedia.org>

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

Reply via email to