Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/173890
Change subject: Start the mockAPI on a random port.
......................................................................
Start the mockAPI on a random port.
This avoids jenkins problems when the `npm 0.8` and `npm 0.10` test builds
both try to use the same port for the Mock API (7001) at the same time.
Change-Id: I2e812e71c36ab0b4349a64102efe5a38ee02f532
---
M tests/apiServer.js
M tests/mocha/api.js
M tests/parserTests.js
M tests/test.localsettings.js
4 files changed, 7 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/90/173890/1
diff --git a/tests/apiServer.js b/tests/apiServer.js
index 39fd84c..c08a8dd 100644
--- a/tests/apiServer.js
+++ b/tests/apiServer.js
@@ -85,7 +85,8 @@
env: {
PORT: port,
INTERFACE: opts.iface,
- NODE_PATH: process.env.NODE_PATH
+ NODE_PATH: process.env.NODE_PATH,
+ PARSOID_MOCKAPI_URL: opts.mockUrl
}
}
);
diff --git a/tests/mocha/api.js b/tests/mocha/api.js
index 0195e26..c1fa512 100644
--- a/tests/mocha/api.js
+++ b/tests/mocha/api.js
@@ -14,10 +14,10 @@
new Promise(function (resolve, reject) {
// Start a mock MediaWiki API server
console.log("Starting mock api");
- apiServer.startMockAPIServer({port: 7001}, resolve);
- }).then(function () {
+ apiServer.startMockAPIServer({}, resolve);
+ }).then(function (mockUrl) {
console.log("starting parsoid");
- apiServer.startParsoidServer(null, function (url) {
+ apiServer.startParsoidServer({ mockUrl: mockUrl },
function (url) {
api = url;
done();
});
diff --git a/tests/parserTests.js b/tests/parserTests.js
index 4b45025..183e41e 100755
--- a/tests/parserTests.js
+++ b/tests/parserTests.js
@@ -2212,7 +2212,7 @@
}
// Start the mock api server and kick off parser tests
-apiServer.startMockAPIServer({ quiet: popts.quiet, port: 7001 }, function(url,
server) {
+apiServer.startMockAPIServer({ quiet: popts.quiet }, function(url, server) {
mockAPIServerURL = url;
mockAPIServer = server;
ptests.main(popts.argv, popts);
diff --git a/tests/test.localsettings.js b/tests/test.localsettings.js
index b78bd92..71aef9e 100644
--- a/tests/test.localsettings.js
+++ b/tests/test.localsettings.js
@@ -9,7 +9,7 @@
exports.setup = function( parsoidConfig ) {
// The URL here is supposed to be your MediaWiki installation root
- parsoidConfig.setInterwiki( 'localhost',
'http://localhost:7001/api.php' );
+ parsoidConfig.setInterwiki( 'localhost',
process.env.PARSOID_MOCKAPI_URL );
// Use the PHP preprocessor to expand templates via the MW API (default
true)
//parsoidConfig.usePHPPreProcessor = false;
--
To view, visit https://gerrit.wikimedia.org/r/173890
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e812e71c36ab0b4349a64102efe5a38ee02f532
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits