tests: Speed up and fix travis (#4453)

Various test runner fixes.
pull/4450/head
webzwo0i 2020-10-30 11:40:11 +01:00 committed by GitHub
parent b41d9762fa
commit b67c9cc136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 20 deletions

View File

@ -8,20 +8,6 @@ services:
cache: false
before_install:
- sudo add-apt-repository -y ppa:libreoffice/ppa
- sudo apt-get update
- sudo apt-get -y install libreoffice
- sudo apt-get -y install libreoffice-pdfimport
install:
- "bin/installDeps.sh"
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
# Installing some plugins
script:
- "tests/frontend/travis/runner.sh"
env:
global:
- secure: "WMGxFkOeTTlhWB+ChMucRtIqVmMbwzYdNHuHQjKCcj8HBEPdZLfCuK/kf4rG\nVLcLQiIsyllqzNhBGVHG1nyqWr0/LTm8JRqSCDDVIhpyzp9KpCJQQJG2Uwjk\n6/HIJJh/wbxsEdLNV2crYU/EiVO3A4Bq0YTHUlbhUqG3mSCr5Ec="
@ -53,9 +39,13 @@ jobs:
- "bin/installDeps.sh"
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
script:
- "tests/frontend/travis/runner.sh"
- "travis_wait 15 tests/frontend/travis/runner.sh"
- name: "Run the Backend tests without Plugins"
install:
- "sudo add-apt-repository -y ppa:libreoffice/ppa"
- "sudo apt-get update"
- "sudo apt-get -y install libreoffice"
- "sudo apt-get -y install libreoffice-pdfimport"
- "bin/installDeps.sh"
- "cd src && npm install && cd -"
script:
@ -87,7 +77,7 @@ jobs:
- *install_plugins
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
script:
- "tests/frontend/travis/runner.sh"
- "travis_wait 15 tests/frontend/travis/runner.sh"
- name: "Lint test package-lock.json"
install:
- "npm install lockfile-lint"
@ -95,6 +85,10 @@ jobs:
- npx lockfile-lint --path src/package-lock.json --validate-https --allowed-hosts npm
- name: "Run the Backend tests with Plugins"
install:
- "sudo add-apt-repository -y ppa:libreoffice/ppa"
- "sudo apt-get update"
- "sudo apt-get -y install libreoffice"
- "sudo apt-get -y install libreoffice-pdfimport"
- "bin/installDeps.sh"
- *install_plugins
- "cd src && npm install && cd -"

View File

@ -151,7 +151,7 @@ describe("the test helper", function(){
}, 2000, 100).fail(function(){
// One at the beginning, and 19-20 more depending on whether it's the timeout or the final
// poll that wins at 2000ms.
expect(checks).to.be.greaterThan(17);
expect(checks).to.be.greaterThan(15);
expect(checks).to.be.lessThan(24);
done();
});
@ -243,7 +243,7 @@ describe("the test helper", function(){
// `checks` is expected to be 20 or 21: one at the beginning, plus 19 or 20 more depending on
// whether it's the timeout or the final poll that wins at 2000ms. Margin is added to reduce
// flakiness on slow test machines.
expect(checks).to.be.greaterThan(17);
expect(checks).to.be.greaterThan(15);
expect(checks).to.be.lessThan(24);
});
});

View File

@ -10,6 +10,10 @@ var config = {
}
var allTestsPassed = true;
// overwrite the default exit code
// in case not all worker can be run (due to saucelabs limits), `queue.drain` below will not be called
// and the script would silently exit with error code 0
process.exitCode = 1;
var sauceTestWorker = async.queue(function (testSettings, callback) {
var browser = wd.promiseChainRemote(config.host, config.port, config.username, config.accessKey);
@ -53,13 +57,13 @@ var sauceTestWorker = async.queue(function (testSettings, callback) {
}
/**
* timeout if a test hangs or the job exceeds 9.5 minutes
* timeout if a test hangs or the job exceeds 14.5 minutes
* It's necessary because if travis kills the saucelabs session due to inactivity, we don't get any output
* @todo this should be configured in testSettings, see https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options#TestConfigurationOptions-Timeouts
*/
var timeout = setTimeout(function(){
stopSauce(false,true);
}, 570000); // travis timeout is 10 minutes, set this to a slightly lower value
}, 870000); // travis timeout is 15 minutes, set this to a slightly lower value
var knownConsoleText = "";
var getStatusInterval = setInterval(function(){