dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Print chained exceptions when maintenance script fails."
[lhc/web/wiklou.git]
/
tests
/
selenium
/
wdio-mediawiki
/
RunJobs.js
diff --git
a/tests/selenium/wdio-mediawiki/RunJobs.js
b/tests/selenium/wdio-mediawiki/RunJobs.js
index
9f36202
..
070ad56
100644
(file)
--- a/
tests/selenium/wdio-mediawiki/RunJobs.js
+++ b/
tests/selenium/wdio-mediawiki/RunJobs.js
@@
-1,19
+1,17
@@
const MWBot = require( 'mwbot' ),
Page = require( './Page' ),
const MWBot = require( 'mwbot' ),
Page = require( './Page' ),
-
FRONT
PAGE_REQUESTS_MAX_RUNS = 10; // (arbitrary) safe-guard against endless execution
+
MAIN
PAGE_REQUESTS_MAX_RUNS = 10; // (arbitrary) safe-guard against endless execution
function getJobCount() {
let bot = new MWBot( {
apiUrl: `${browser.options.baseUrl}/api.php`
} );
function getJobCount() {
let bot = new MWBot( {
apiUrl: `${browser.options.baseUrl}/api.php`
} );
- return new Promise( ( resolve ) => {
- return bot.request( {
- action: 'query',
- meta: 'siteinfo',
- siprop: 'statistics'
- } ).then( ( response ) => {
- resolve( response.query.statistics.jobs );
- } );
+ return bot.request( {
+ action: 'query',
+ meta: 'siteinfo',
+ siprop: 'statistics'
+ } ).then( ( response ) => {
+ return response.query.statistics.jobs;
} );
}
} );
}
@@
-21,9
+19,9
@@
function log( message ) {
process.stdout.write( `RunJobs ${message}\n` );
}
process.stdout.write( `RunJobs ${message}\n` );
}
-function runThrough
Front
PageRequests( runCount = 1 ) {
+function runThrough
Main
PageRequests( runCount = 1 ) {
let page = new Page();
let page = new Page();
- log( `through requests to the
front
page (run ${runCount}).` );
+ log( `through requests to the
main
page (run ${runCount}).` );
page.openTitle( '' );
page.openTitle( '' );
@@
-33,11
+31,11
@@
function runThroughFrontPageRequests( runCount = 1 ) {
return;
}
log( `detected ${jobCount} more queued job(s).` );
return;
}
log( `detected ${jobCount} more queued job(s).` );
- if ( runCount >=
FRONT
PAGE_REQUESTS_MAX_RUNS ) {
- log( 'stopping requests to the
front
page due to reached limit.' );
+ if ( runCount >=
MAIN
PAGE_REQUESTS_MAX_RUNS ) {
+ log( 'stopping requests to the
main
page due to reached limit.' );
return;
}
return;
}
- return runThrough
Front
PageRequests( ++runCount );
+ return runThrough
Main
PageRequests( ++runCount );
} );
}
} );
}
@@
-65,7
+63,7
@@
class RunJobs {
static run() {
browser.call( () => {
static run() {
browser.call( () => {
- return runThrough
Front
PageRequests();
+ return runThrough
Main
PageRequests();
} );
}
}
} );
}
}