etherpad-lite/src/tests/frontend/travis/remote_runner.js

195 lines
5.8 KiB
JavaScript
Raw Normal View History

Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
'use strict';
2021-02-03 13:08:43 +01:00
const async = require('async');
const wd = require('wd');
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
const config = {
host: 'ondemand.saucelabs.com',
port: 80,
username: process.env.SAUCE_USER,
accessKey: process.env.SAUCE_ACCESS_KEY,
};
const isAdminRunner = process.argv[2] === 'admin';
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
let allTestsPassed = true;
// overwrite the default exit code
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
// 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 = 2;
process.on('exit', (code) => {
if (code === 2) {
console.log('\x1B[31mFAILED\x1B[39m Not all saucelabs runner have been started.');
}
});
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
const sauceTestWorker = async.queue((testSettings, callback) => {
const browser = wd.promiseChainRemote(
config.host, config.port, config.username, config.accessKey);
const name =
`${process.env.GIT_HASH} - ${testSettings.browserName} ` +
`${testSettings.version}, ${testSettings.platform}`;
2012-11-03 16:55:14 +01:00
testSettings.name = name;
testSettings.public = true;
testSettings.build = process.env.GIT_HASH;
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
// console.json can be downloaded via saucelabs,
// don't know how to print them into output of the tests
testSettings.extendedDebugging = true;
testSettings.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
browser.init(testSettings).get('http://localhost:9001/tests/frontend/', () => {
const url = `https://saucelabs.com/jobs/${browser.sessionID}`;
console.log(`Remote sauce test '${name}' started! ${url}`);
// tear down the test excecution
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
const stopSauce = (success, timesup) => {
clearInterval(getStatusInterval);
clearTimeout(timeout);
browser.quit(() => {
if (!success) {
allTestsPassed = false;
}
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
// if stopSauce is called via timeout
// (in contrast to via getStatusInterval) than the log of up to the last
// five seconds may not be available here. It's an error anyway, so don't care about it.
printLog(logIndex);
if (timesup) {
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
console.log(`[${testSettings.browserName} ${testSettings.platform}` +
`${testSettings.version === '' ? '' : (` ${testSettings.version}`)}]` +
' \x1B[31mFAILED\x1B[39m allowed test duration exceeded');
}
console.log(`Remote sauce test '${name}' finished! ${url}`);
callback();
});
};
/**
* timeout if a test hangs or the job exceeds 14.5 minutes
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
* 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
*/
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
const timeout = setTimeout(() => {
stopSauce(false, true);
}, 870000); // travis timeout is 15 minutes, set this to a slightly lower value
let knownConsoleText = '';
// how many characters of the log have been sent to travis
let logIndex = 0;
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
const getStatusInterval = setInterval(() => {
browser.eval("$('#console').text()", (err, consoleText) => {
if (!consoleText || err) {
return;
}
knownConsoleText = consoleText;
if (knownConsoleText.indexOf('FINISHED') > 0) {
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
const match = knownConsoleText.match(
/FINISHED.*([0-9]+) tests passed, ([0-9]+) tests failed/);
// finished without failures
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
if (match[2] && match[2] === '0') {
stopSauce(true);
tests: Fix frontend tests (#4188), ugly work around for "Pad never loaded" (#4200) * remote_runner.js: fix drain call (cf. https://github.com/caolan/async/blob/master/CHANGELOG.md#breaking-changes) * dont wait 30 seconds after remote_runner.js returned * timeout frontend tests after 9.5 minutes to prevent travis from silently stop them * log when not all tests finished * prevent killTimeout to happen after last test * log server messages to console * remote_runner will take some time to setup sl, so this second is not necessary * dont write to global mocha variable * mochas `test end` event is not called when a before/beforeEach-hooks failed, so we should only use pass/fail/pending-hooks for logging. also some cruft removed * pass test in `pending`-event handler * remove some more cruft in tests/frontend/runner.js * frontend tests: clarify why stats.tests and total differ * move killTimeout to pass/fail/pending instead of `test end` to guarantee that it is run * delete killTimeout on test end to prevent misleading log message * unused variable * fix regex * unlikely edge case * ensure `allowed test duration exceeded` message is printed for the last runner * get rid of jquery.iframe.js, currently no support for IE<9 * retry up to 3 times when pad could not be loaded * Call the logging code in stopSauce in a callback for `browser.quit()`. This should fix cases like https://app.saucelabs.com/tests/cb8225375d274cbcbb091309f5466cfd Travis received all the logs and remote_runner.js exits, but there never is a DELETE command for webdriver.
2020-07-28 20:57:33 +02:00
// finished but some tests did not return or some tests failed
} else {
stopSauce(false);
}
} else {
// not finished yet
printLog(logIndex);
logIndex = knownConsoleText.length;
}
});
}, 5000);
/**
* Replaces color codes in the test runners log, appends
* browser name, platform etc. to every line and prints them.
*
* @param {number} index offset from where to start
*/
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
const printLog = (index) => {
let testResult = knownConsoleText.substring(index)
.replace(/\[red\]/g, '\x1B[31m').replace(/\[yellow\]/g, '\x1B[33m')
.replace(/\[green\]/g, '\x1B[32m').replace(/\[clear\]/g, '\x1B[39m');
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
testResult = testResult.split('\\n').map((line) => `[${testSettings.browserName} ` +
`${testSettings.platform}` +
`${testSettings.version === '' ? '' : (` ${testSettings.version}`)}]` +
`${line}`).join('\n');
console.log(testResult);
Low hanging lint frontend tests (#4695) * lint: low hanging specs/alphabet.js * lint: low hanging specs/authorship_of_editions.js * lint: low hanging specs/bold.js * lint: low hanging specs/caret.js * lint: low hanging specs/change_user_color.js * lint: low hanging specs/change_user_name.js * lint: low hanging specs/chat.js * lint: low hanging specs/chat_load_messages.js * lint: low hanging specs/clear_authorship_colors.js * lint: low hanging specs/delete.js * lint: low hanging specs/drag_and_drop.js * lint: low hanging specs/embed_value.js * lint: low hanging specs/enter.js * lint: low hanging specs/font_type.js * lint: low hanging specs/helper.js * lint: low hanging specs/importexport.js * lint: low hanging specs/importindents.js * lint: low hanging specs/indentation.js * lint: low hanging specs/italic.js * lint: low hanging specs/language.js * lint: low hanging specs/multiple_authors_clear_authorship_colors.js * lint: low hanging specs/ordered_list.js * lint: low hanging specs/pad_modal.js * lint: low hanging specs/redo.js * lint: low hanging specs/responsiveness.js * lint: low hanging specs/select_formatting_buttons.js * lint: low hanging specs/strikethrough.js * lint: low hanging specs/timeslider.js * lint: low hanging specs/timeslider_labels.js * lint: low hanging specs/timeslider_numeric_padID.js * lint: low hanging specs/timeslider_revisions.js * lint: low hanging specs/undo.js * lint: low hanging specs/unordered_list.js * lint: low hanging specs/xxauto_reconnect.js * lint: attempt to do remote_runner.js * lint: helper linting * lint: rate limit linting * use constructor for Event to make eslint happier * for squash: lint fix refinements * for squash: lint fix refinements Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2021-02-01 21:23:14 +01:00
};
});
}, 6); // run 6 tests in parrallel
2012-11-03 16:55:14 +01:00
if (!isAdminRunner) {
// 1) Firefox on Linux
sauceTestWorker.push({
platform: 'Windows 7',
browserName: 'firefox',
version: '52.0',
});
2020-05-29 18:52:00 +02:00
// 2) Chrome on Linux
sauceTestWorker.push({
platform: 'Windows 7',
browserName: 'chrome',
version: '55.0',
args: ['--use-fake-device-for-media-stream'],
});
2020-05-29 18:52:00 +02:00
/*
// 3) Safari on OSX 10.15
sauceTestWorker.push({
'platform' : 'OS X 10.15'
, 'browserName' : 'safari'
, 'version' : '13.1'
});
*/
// 4) Safari on OSX 10.14
sauceTestWorker.push({
platform: 'OS X 10.15',
browserName: 'safari',
version: '13.1',
});
// IE 10 doesn't appear to be working anyway
/*
// 4) IE 10 on Win 8
sauceTestWorker.push({
'platform' : 'Windows 8'
, 'browserName' : 'iexplore'
, 'version' : '10.0'
});
*/
// 5) Edge on Win 10
sauceTestWorker.push({
platform: 'Windows 10',
browserName: 'microsoftedge',
version: '83.0',
});
// 6) Firefox on Win 7
sauceTestWorker.push({
platform: 'Windows 7',
browserName: 'firefox',
version: '78.0',
});
} else {
// 4) Safari on OSX 10.14
sauceTestWorker.push({
platform: 'OS X 10.15',
browserName: 'safari',
version: '13.1',
});
}
sauceTestWorker.drain(() => {
tests: Fix frontend tests (#4188), ugly work around for "Pad never loaded" (#4200) * remote_runner.js: fix drain call (cf. https://github.com/caolan/async/blob/master/CHANGELOG.md#breaking-changes) * dont wait 30 seconds after remote_runner.js returned * timeout frontend tests after 9.5 minutes to prevent travis from silently stop them * log when not all tests finished * prevent killTimeout to happen after last test * log server messages to console * remote_runner will take some time to setup sl, so this second is not necessary * dont write to global mocha variable * mochas `test end` event is not called when a before/beforeEach-hooks failed, so we should only use pass/fail/pending-hooks for logging. also some cruft removed * pass test in `pending`-event handler * remove some more cruft in tests/frontend/runner.js * frontend tests: clarify why stats.tests and total differ * move killTimeout to pass/fail/pending instead of `test end` to guarantee that it is run * delete killTimeout on test end to prevent misleading log message * unused variable * fix regex * unlikely edge case * ensure `allowed test duration exceeded` message is printed for the last runner * get rid of jquery.iframe.js, currently no support for IE<9 * retry up to 3 times when pad could not be loaded * Call the logging code in stopSauce in a callback for `browser.quit()`. This should fix cases like https://app.saucelabs.com/tests/cb8225375d274cbcbb091309f5466cfd Travis received all the logs and remote_runner.js exits, but there never is a DELETE command for webdriver.
2020-07-28 20:57:33 +02:00
process.exit(allTestsPassed ? 0 : 1);
});