mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
tests: Resolve Gateway timeout during automated tests by adding delay after minify request
* Remove npm cache from Travis, this was causing a world of pain. * Remove the broken line attribute tests. * Do a HTTP get against Etherpad to begin minification. * Wait 10 seconds after minification before running tests.
This commit is contained in:
parent
b92b8a66e1
commit
d8e067a5f9
3 changed files with 51 additions and 46 deletions
|
@ -6,10 +6,12 @@ node_js:
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
|
cache:
|
||||||
|
npm: false
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- "bin/installDeps.sh"
|
- "bin/installDeps.sh"
|
||||||
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
|
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
|
||||||
- "npm install ep_test_line_attrib"
|
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- "tests/frontend/travis/sauce_tunnel.sh"
|
- "tests/frontend/travis/sauce_tunnel.sh"
|
||||||
|
@ -33,7 +35,6 @@ jobs:
|
||||||
install:
|
install:
|
||||||
- "bin/installDeps.sh"
|
- "bin/installDeps.sh"
|
||||||
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
|
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
|
||||||
- "npm install ep_test_line_attrib"
|
|
||||||
script:
|
script:
|
||||||
- "tests/frontend/travis/runner.sh"
|
- "tests/frontend/travis/runner.sh"
|
||||||
- name: "Test the Dockerfile"
|
- name: "Test the Dockerfile"
|
||||||
|
|
|
@ -18,53 +18,58 @@ var sauceTestWorker = async.queue(function (testSettings, callback) {
|
||||||
testSettings["public"] = true;
|
testSettings["public"] = true;
|
||||||
testSettings["build"] = process.env.GIT_HASH;
|
testSettings["build"] = process.env.GIT_HASH;
|
||||||
|
|
||||||
browser.init(testSettings).get("http://localhost:9001/tests/frontend/", function(){
|
// we wait 10 seconds here with the hope it was enough time for the minified files to be built etc.
|
||||||
var url = "https://saucelabs.com/jobs/" + browser.sessionID;
|
setTimeout(function(){
|
||||||
console.log("Remote sauce test '" + name + "' started! " + url);
|
browser.init(testSettings).get("http://localhost:9001/tests/frontend/", function(){
|
||||||
|
var url = "https://saucelabs.com/jobs/" + browser.sessionID;
|
||||||
|
console.log("Remote sauce test '" + name + "' started! " + url);
|
||||||
|
|
||||||
//tear down the test excecution
|
//tear down the test excecution
|
||||||
var stopSauce = function(success){
|
var stopSauce = function(success){
|
||||||
getStatusInterval && clearInterval(getStatusInterval);
|
getStatusInterval && clearInterval(getStatusInterval);
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
||||||
browser.quit();
|
browser.quit();
|
||||||
|
|
||||||
if(!success){
|
if(!success){
|
||||||
allTestsPassed = false;
|
allTestsPassed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var testResult = knownConsoleText.replace(/\[red\]/g,'\x1B[31m').replace(/\[yellow\]/g,'\x1B[33m')
|
||||||
|
.replace(/\[green\]/g,'\x1B[32m').replace(/\[clear\]/g, '\x1B[39m');
|
||||||
|
testResult = testResult.split("\\n").map(function(line){
|
||||||
|
return "[" + testSettings.browserName + (testSettings.version === "" ? '' : (" " + testSettings.version)) + "] " + line;
|
||||||
|
}).join("\n");
|
||||||
|
|
||||||
|
console.log(testResult);
|
||||||
|
console.log("Remote sauce test '" + name + "' finished! " + url);
|
||||||
|
|
||||||
|
callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
var testResult = knownConsoleText.replace(/\[red\]/g,'\x1B[31m').replace(/\[yellow\]/g,'\x1B[33m')
|
//timeout for the case the test hangs
|
||||||
.replace(/\[green\]/g,'\x1B[32m').replace(/\[clear\]/g, '\x1B[39m');
|
var timeout = setTimeout(function(){
|
||||||
testResult = testResult.split("\\n").map(function(line){
|
stopSauce(false);
|
||||||
return "[" + testSettings.browserName + (testSettings.version === "" ? '' : (" " + testSettings.version)) + "] " + line;
|
}, 60000 * 10);
|
||||||
}).join("\n");
|
|
||||||
|
|
||||||
console.log(testResult);
|
var knownConsoleText = "";
|
||||||
console.log("Remote sauce test '" + name + "' finished! " + url);
|
var getStatusInterval = setInterval(function(){
|
||||||
|
browser.eval("$('#console').text()", function(err, consoleText){
|
||||||
|
if(!consoleText || err){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
knownConsoleText = consoleText;
|
||||||
|
|
||||||
callback();
|
if(knownConsoleText.indexOf("FINISHED") > 0){
|
||||||
}
|
var success = knownConsoleText.indexOf("FAILED") === -1;
|
||||||
|
stopSauce(success);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 5000);
|
||||||
|
});
|
||||||
|
|
||||||
//timeout for the case the test hangs
|
}, 10000);
|
||||||
var timeout = setTimeout(function(){
|
|
||||||
stopSauce(false);
|
|
||||||
}, 60000 * 10);
|
|
||||||
|
|
||||||
var knownConsoleText = "";
|
|
||||||
var getStatusInterval = setInterval(function(){
|
|
||||||
browser.eval("$('#console').text()", function(err, consoleText){
|
|
||||||
if(!consoleText || err){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
knownConsoleText = consoleText;
|
|
||||||
|
|
||||||
if(knownConsoleText.indexOf("FINISHED") > 0){
|
|
||||||
var success = knownConsoleText.indexOf("FAILED") === -1;
|
|
||||||
stopSauce(success);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, 5000);
|
|
||||||
});
|
|
||||||
}, 5); //run 5 tests in parrallel
|
}, 5); //run 5 tests in parrallel
|
||||||
|
|
||||||
// 1) Firefox on Linux
|
// 1) Firefox on Linux
|
||||||
|
@ -73,28 +78,24 @@ sauceTestWorker.push({
|
||||||
, 'browserName' : 'firefox'
|
, 'browserName' : 'firefox'
|
||||||
, 'version' : 'latest'
|
, 'version' : 'latest'
|
||||||
});
|
});
|
||||||
|
|
||||||
// 2) Chrome on Linux
|
// 2) Chrome on Linux
|
||||||
sauceTestWorker.push({
|
sauceTestWorker.push({
|
||||||
'platform' : 'Linux'
|
'platform' : 'Linux'
|
||||||
, 'browserName' : 'googlechrome'
|
, 'browserName' : 'googlechrome'
|
||||||
, 'version' : 'latest'
|
, 'version' : 'latest'
|
||||||
});
|
});
|
||||||
|
|
||||||
// 3) Safari on OSX 10.15
|
// 3) Safari on OSX 10.15
|
||||||
sauceTestWorker.push({
|
sauceTestWorker.push({
|
||||||
'platform' : 'OS X 10.15'
|
'platform' : 'OS X 10.15'
|
||||||
, 'browserName' : 'safari'
|
, 'browserName' : 'safari'
|
||||||
, 'version' : 'latest'
|
, 'version' : 'latest'
|
||||||
});
|
});
|
||||||
|
|
||||||
// 4) IE 10 on Win 8
|
// 4) IE 10 on Win 8
|
||||||
sauceTestWorker.push({
|
sauceTestWorker.push({
|
||||||
'platform' : 'Windows 8'
|
'platform' : 'Windows 8'
|
||||||
, 'browserName' : 'iexplore'
|
, 'browserName' : 'iexplore'
|
||||||
, 'version' : '10.0'
|
, 'version' : '10.0'
|
||||||
});
|
});
|
||||||
|
|
||||||
// 5) Edge on Win 10
|
// 5) Edge on Win 10
|
||||||
sauceTestWorker.push({
|
sauceTestWorker.push({
|
||||||
'platform' : 'Windows 10'
|
'platform' : 'Windows 10'
|
||||||
|
|
|
@ -28,8 +28,11 @@ echo "Now I will try for 15 seconds to connect to Etherpad on http://localhost:9
|
||||||
|
|
||||||
echo "Successfully connected to Etherpad on http://localhost:9001"
|
echo "Successfully connected to Etherpad on http://localhost:9001"
|
||||||
|
|
||||||
# just in case, let's wait for another second before going on
|
# Build the minified files?
|
||||||
sleep 1
|
curl http://localhost:9001/p/minifyme -f -s
|
||||||
|
|
||||||
|
# just in case, let's wait for another 10 seconds before going on
|
||||||
|
sleep 10
|
||||||
|
|
||||||
# a copy of settings.json is necessary for the backend tests to work
|
# a copy of settings.json is necessary for the backend tests to work
|
||||||
cp settings.json.template settings.json
|
cp settings.json.template settings.json
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue