fix(tests): Add timeout on all async tests

This commit is contained in:
smizrahi
2024-09-26 21:02:50 +02:00
parent 59d48cb382
commit 64f17880c7
20 changed files with 84 additions and 4 deletions

View File

@@ -13,6 +13,10 @@ let utility, user, attendee1, attendee1Delegate
let userCalendar, attendee1Calendar, attendee1DelegateCalendar let userCalendar, attendee1Calendar, attendee1DelegateCalendar
let icsName, icsList, vcalendar let icsName, icsList, vcalendar
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('PreventInvitations', function() { describe('PreventInvitations', function() {
const _getEvent = async function(client, calendarName, filename, expectedCode = 200) { const _getEvent = async function(client, calendarName, filename, expectedCode = 200) {

View File

@@ -2,6 +2,10 @@ import config from '../lib/config'
import WebDAV from '../lib/WebDAV' import WebDAV from '../lib/WebDAV'
import TestUtility from '../lib/utilities' import TestUtility from '../lib/utilities'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('read and set calendar properties', function() { describe('read and set calendar properties', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)
const utility = new TestUtility(webdav) const utility = new TestUtility(webdav)

View File

@@ -3,6 +3,10 @@ import WebDAV from '../lib/WebDAV'
import TestUtility from '../lib/utilities' import TestUtility from '../lib/utilities'
import ICAL from 'ical.js' import ICAL from 'ical.js'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('CalDAV Scheduling', function() { describe('CalDAV Scheduling', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)
const webdav_su = new WebDAV(config.superuser, config.superuser_password) const webdav_su = new WebDAV(config.superuser, config.superuser_password)
@@ -933,5 +937,5 @@ describe('CalDAV Scheduling', function() {
vcalendarInvitationAttendee = await _getEvent(webdavAttendee1, attendee1Calendar, icsName, 404) vcalendarInvitationAttendee = await _getEvent(webdavAttendee1, attendee1Calendar, icsName, 404)
vcalendarInvitationDelegate = await _getEvent(webdavAttendee1Delegate, attendee1DelegateCalendar, icsName, 404) vcalendarInvitationDelegate = await _getEvent(webdavAttendee1Delegate, attendee1DelegateCalendar, icsName, 404)
}, 10000) // increase timeout for this long test }) // increase timeout for this long test
}) })

View File

@@ -70,6 +70,10 @@ X-AIM:pseudo aim
END:VCARD` END:VCARD`
} }
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('CardDAV extensions', function() { describe('CardDAV extensions', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)
const webdav_su = new WebDAV(config.superuser, config.superuser_password) const webdav_su = new WebDAV(config.superuser, config.superuser_password)
@@ -232,7 +236,7 @@ describe('CardDAV extensions', function() {
expect(emails) expect(emails)
.withContext(`Returned vCard has email of ${config.attendee1_username} (${config.attendee1})`) .withContext(`Returned vCard has email of ${config.attendee1_username} (${config.attendee1})`)
.toContain(config.attendee1) .toContain(config.attendee1)
}, 10000) // increase timeout for this long test }) // increase timeout for this long test
// CARDDAV:addressbook-multiget Report // CARDDAV:addressbook-multiget Report
// https://datatracker.ietf.org/doc/html/rfc6352#section-8.7 // https://datatracker.ietf.org/doc/html/rfc6352#section-8.7

View File

@@ -1,5 +1,9 @@
import config from '../lib/config' import config from '../lib/config'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('config tests', function() { describe('config tests', function() {
it('required configuration parameters', async function() { it('required configuration parameters', async function() {

View File

@@ -2,6 +2,10 @@ import config from '../lib/config'
import WebDAV from '../lib/WebDAV' import WebDAV from '../lib/WebDAV'
import TestUtility from '../lib/utilities' import TestUtility from '../lib/utilities'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('create, read, modify, delete tasks for regular user', function() { describe('create, read, modify, delete tasks for regular user', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)
const webdav_su = new WebDAV(config.superuser, config.superuser_password) const webdav_su = new WebDAV(config.superuser, config.superuser_password)

View File

@@ -2,6 +2,10 @@ import config from '../lib/config'
import WebDAV from '../lib/WebDAV' import WebDAV from '../lib/WebDAV'
import TestUtility from '../lib/utilities' import TestUtility from '../lib/utilities'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('create, read, modify, delete events for regular user', function() { describe('create, read, modify, delete events for regular user', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)
const webdav_su = new WebDAV(config.superuser, config.superuser_password) const webdav_su = new WebDAV(config.superuser, config.superuser_password)

View File

@@ -10,6 +10,10 @@ import TestUtility from '../lib/utilities'
* additional calendars. * additional calendars.
*/ */
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('Apple iCal', function() { describe('Apple iCal', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)
const webdav_su = new WebDAV(config.superuser, config.superuser_password) const webdav_su = new WebDAV(config.superuser, config.superuser_password)
@@ -229,5 +233,5 @@ describe('Apple iCal', function() {
.toBe(0) .toBe(0)
await webdav_su.deleteObject(otherResource) await webdav_su.deleteObject(otherResource)
}, 10000) // increase timeout for this long test }) // increase timeout for this long test
}) })

View File

@@ -1,6 +1,10 @@
import config from '../lib/config' import config from '../lib/config'
import { default as WebDAV, DAVInverse } from '../lib/WebDAV' import { default as WebDAV, DAVInverse } from '../lib/WebDAV'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('calendar classification', function() { describe('calendar classification', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)

View File

@@ -2,6 +2,10 @@ import config from '../lib/config'
import WebDAV from '../lib/WebDAV' import WebDAV from '../lib/WebDAV'
import TestUtility from '../lib/utilities' import TestUtility from '../lib/utilities'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('public access', function() { describe('public access', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)
const webdav_anon = new WebDAV() const webdav_anon = new WebDAV()

View File

@@ -2,6 +2,10 @@ import config from '../lib/config'
import WebDAV from '../lib/WebDAV' import WebDAV from '../lib/WebDAV'
import TestUtility from '../lib/utilities' import TestUtility from '../lib/utilities'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('DAVCalendarSuperUserAcl', function() { describe('DAVCalendarSuperUserAcl', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)
const webdav_su = new WebDAV(config.superuser, config.superuser_password) const webdav_su = new WebDAV(config.superuser, config.superuser_password)

View File

@@ -1,6 +1,10 @@
import config from '../lib/config' import config from '../lib/config'
import { default as WebDAV, DAVInverse } from '../lib/WebDAV' import { default as WebDAV, DAVInverse } from '../lib/WebDAV'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('contacts categories', function() { describe('contacts categories', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)

View File

@@ -1,6 +1,10 @@
import config from '../lib/config' import config from '../lib/config'
import WebDAV from '../lib/WebDAV' import WebDAV from '../lib/WebDAV'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('public access', function() { describe('public access', function() {
const webdav_anon = new WebDAV() const webdav_anon = new WebDAV()

View File

@@ -3,6 +3,10 @@ import WebDAV from '../lib/WebDAV'
let webdav, resource let webdav, resource
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('HTTP Calendar', function() { describe('HTTP Calendar', function() {
beforeAll(async function() { beforeAll(async function() {

View File

@@ -3,6 +3,10 @@ import Preferences from '../lib/Preferences'
const prefs = new Preferences(config.username, config.password) const prefs = new Preferences(config.username, config.password)
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('preferences', function() { describe('preferences', function() {
// preferencesTest // preferencesTest

View File

@@ -152,6 +152,10 @@ let msg3Size = 720
let webdav, utility let webdav, utility
let user, resource, mailboxesList let user, resource, mailboxesList
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
// DAVMailCollectionTest // DAVMailCollectionTest
describe('MailDAV', function() { describe('MailDAV', function() {

View File

@@ -6,6 +6,10 @@ import ManageSieve from '../lib/ManageSieve'
let prefs, webdav, utility, manageSieve, user let prefs, webdav, utility, manageSieve, user
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('Sieve', function() { describe('Sieve', function() {
async function _getSogoSieveScript() { async function _getSogoSieveScript() {

View File

@@ -5,6 +5,10 @@ const os = require('os')
const path = require('path') const path = require('path')
const { execSync } = require('child_process') const { execSync } = require('child_process')
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('sogo-tool tests', function() { describe('sogo-tool tests', function() {
let tmpdir, isRoot let tmpdir, isRoot

View File

@@ -2,6 +2,10 @@ import config from '../lib/config'
import WebDAV from '../lib/WebDAV' import WebDAV from '../lib/WebDAV'
import TestUtility from '../lib/utilities' import TestUtility from '../lib/utilities'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('WebDAV', function() { describe('WebDAV', function() {
var webdav var webdav
var utility var utility

View File

@@ -3,6 +3,10 @@ import WebDAV from '../lib/WebDAV'
import { DAVNamespace, DAVNamespaceShorthandMap } from 'tsdav' import { DAVNamespace, DAVNamespaceShorthandMap } from 'tsdav'
import convert from 'xml-js' import convert from 'xml-js'
beforeAll(function () {
jasmine.DEFAULT_TIMEOUT_INTERVAL = config.timeout || 10000;
});
describe('webdav sync', function() { describe('webdav sync', function() {
const webdav = new WebDAV(config.username, config.password) const webdav = new WebDAV(config.username, config.password)
const webdav_su = new WebDAV(config.superuser, config.superuser_password) const webdav_su = new WebDAV(config.superuser, config.superuser_password)