Merge pull request #3752 from thelounge/xpaw/fix-ci-timeout

Fix increasing test timeout on github actions
This commit is contained in:
Richard Lewis 2020-02-10 16:41:23 +02:00 committed by GitHub
commit f7f92c5f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 8 deletions

View File

@ -125,8 +125,8 @@ function testLdapAuth() {
describe("LDAP authentication plugin", function() { describe("LDAP authentication plugin", function() {
// Increase timeout due to unpredictable I/O on CI services // Increase timeout due to unpredictable I/O on CI services
this.timeout(process.env.CI ? 25000 : 5000); this.timeout(TestUtil.isRunningOnCI() ? 25000 : 5000);
this.slow(200); this.slow(300);
let server; let server;

View File

@ -8,8 +8,8 @@ const link = require("../../src/plugins/irc-events/link.js");
describe("Link plugin", function() { describe("Link plugin", function() {
// Increase timeout due to unpredictable I/O on CI services // Increase timeout due to unpredictable I/O on CI services
this.timeout(process.env.CI ? 25000 : 5000); this.timeout(util.isRunningOnCI() ? 25000 : 5000);
this.slow(200); this.slow(300);
const loremIpsum = `Lorem ipsum dolor sit amet, consectetur adipiscing elit.\ const loremIpsum = `Lorem ipsum dolor sit amet, consectetur adipiscing elit.\
Vivamus at pretium mauris. Aenean eu orci id erat pulvinar\ Vivamus at pretium mauris. Aenean eu orci id erat pulvinar\

View File

@ -3,13 +3,15 @@
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const expect = require("chai").expect; const expect = require("chai").expect;
const util = require("../util");
const Msg = require("../../src/models/msg"); const Msg = require("../../src/models/msg");
const Helper = require("../../src/helper"); const Helper = require("../../src/helper");
const MessageStorage = require("../../src/plugins/messageStorage/sqlite.js"); const MessageStorage = require("../../src/plugins/messageStorage/sqlite.js");
describe("SQLite Message Storage", function() { describe("SQLite Message Storage", function() {
// Increase timeout due to unpredictable I/O on CI services // Increase timeout due to unpredictable I/O on CI services
this.timeout(process.env.CI ? 25000 : 5000); this.timeout(util.isRunningOnCI() ? 25000 : 5000);
this.slow(300);
const expectedPath = path.join(Helper.getHomePath(), "logs", "testUser.sqlite3"); const expectedPath = path.join(Helper.getHomePath(), "logs", "testUser.sqlite3");
let store; let store;

View File

@ -10,8 +10,8 @@ const link = require("../../src/plugins/irc-events/link.js");
describe("Image storage", function() { describe("Image storage", function() {
// Increase timeout due to unpredictable I/O on CI services // Increase timeout due to unpredictable I/O on CI services
this.timeout(process.env.CI ? 25000 : 5000); this.timeout(util.isRunningOnCI() ? 25000 : 5000);
this.slow(200); this.slow(300);
const testImagePath = path.resolve(__dirname, "../../client/img/logo-grey-bg-120x120px.png"); const testImagePath = path.resolve(__dirname, "../../client/img/logo-grey-bg-120x120px.png");
const correctImageHash = crypto const correctImageHash = crypto

View File

@ -6,11 +6,12 @@ const expect = require("chai").expect;
const stub = require("sinon").stub; const stub = require("sinon").stub;
const got = require("got"); const got = require("got");
const io = require("socket.io-client"); const io = require("socket.io-client");
const util = require("./util");
const changelog = require("../src/plugins/changelog"); const changelog = require("../src/plugins/changelog");
describe("Server", function() { describe("Server", function() {
// Increase timeout due to unpredictable I/O on CI services // Increase timeout due to unpredictable I/O on CI services
this.timeout(process.env.CI ? 25000 : 5000); this.timeout(util.isRunningOnCI() ? 25000 : 5000);
let server; let server;

View File

@ -61,4 +61,7 @@ module.exports = {
return express(); return express();
}, },
sanitizeLog, sanitizeLog,
isRunningOnCI() {
return process.env.CI || process.env.GITHUB_ACTIONS;
},
}; };