Fix increasing test timeout on github actions

This commit is contained in:
Pavel Djundik 2020-02-09 14:21:45 +02:00
parent 0f44c51b00
commit 1b2894bf99
6 changed files with 14 additions and 8 deletions

View File

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

View File

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

View File

@ -3,13 +3,15 @@
const fs = require("fs");
const path = require("path");
const expect = require("chai").expect;
const util = require("../util");
const Msg = require("../../src/models/msg");
const Helper = require("../../src/helper");
const MessageStorage = require("../../src/plugins/messageStorage/sqlite.js");
describe("SQLite Message Storage", function() {
// 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");
let store;

View File

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

View File

@ -6,11 +6,12 @@ const expect = require("chai").expect;
const stub = require("sinon").stub;
const got = require("got");
const io = require("socket.io-client");
const util = require("./util");
const changelog = require("../src/plugins/changelog");
describe("Server", function() {
// 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;

View File

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