Skip to content

Commit

Permalink
Remove this.retries(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Jun 23, 2024
1 parent d88904e commit 191e534
Show file tree
Hide file tree
Showing 64 changed files with 70 additions and 182 deletions.
7 changes: 4 additions & 3 deletions apps/meteor/.mocharc.api.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
'use strict';

/**
/*
* Mocha configuration for REST API integration tests.
*/

module.exports = {
module.exports = /** @satisfies {import('mocha').MochaOptions} */ ({
...require('./.mocharc.base.json'), // see https://github.com/mochajs/mocha/issues/3916
timeout: 10000,
bail: true,
retries: 0,
file: 'tests/end-to-end/teardown.ts',
spec: ['tests/end-to-end/api/**/*', 'tests/end-to-end/apps/*'],
};
});
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/00-autotranslate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ const resetE2EDefaults = async () => {
await Promise.all([updateSetting('E2E_Enabled_Default_PrivateRooms', false), updateSetting('E2E_Enable', false)]);
};

describe('AutoTranslate', function () {
this.retries(0);

describe('AutoTranslate', () => {
before((done) => getCredentials(done));

describe('[AutoTranslate]', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/00-miscellaneous.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import type { TestUser } from '../../data/users.helper';
import { createUser, deleteUser, login as doLogin } from '../../data/users.helper';
import { IS_EE } from '../../e2e/config/constants';

describe('miscellaneous', function () {
this.retries(0);

describe('miscellaneous', () => {
before((done) => getCredentials(done));

describe('API default', () => {
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/end-to-end/api/01-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,9 @@ const updateUserInDb = async (userId: IUser['_id'], userData: Partial<IUser>) =>
await connection.close();
};

describe('[Users]', function () {
describe('[Users]', () => {
let targetUser: { _id: IUser['_id']; username: string };
let userCredentials: Credentials;
this.retries(0);

before((done) => getCredentials(done));

Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/02-channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ function getRoomInfo(roomId: IRoom['_id']) {
});
}

describe('[Channels]', function () {
describe('[Channels]', () => {
let channel: Pick<IRoom, '_id' | 'name'>;
const apiPublicChannelName = `api-channel-test-${Date.now()}`;

this.retries(0);

before((done) => getCredentials(done));

before('Creating channel', (done) => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/03-groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ function getRoomInfo(roomId: IRoom['_id']) {
});
}

describe('[Groups]', function () {
describe('[Groups]', () => {
let group: {
_id: string;
name: string;
};

this.retries(0);

before((done) => getCredentials(done));

before(async () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/04-direct-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import { password, adminUsername } from '../../data/user';
import type { TestUser } from '../../data/users.helper';
import { createUser, deleteUser, login } from '../../data/users.helper';

describe('[Direct Messages]', function () {
this.retries(0);

describe('[Direct Messages]', () => {
let directMessage: { _id: IRoom['_id'] };

before((done) => getCredentials(done));
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/end-to-end/api/05-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ const pinMessage = ({ msgId }: { msgId: IMessage['_id'] }) => {
});
};

describe('[Chat]', function () {
this.retries(0);
describe('[Chat]', () => {
let testChannel: IRoom;
let message: { _id: IMessage['_id'] };

Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/06-outgoing-integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import { password } from '../../data/user';
import type { TestUser } from '../../data/users.helper';
import { createUser, deleteUser, login } from '../../data/users.helper';

describe('[Outgoing Integrations]', function () {
this.retries(0);

describe('[Outgoing Integrations]', () => {
let integrationCreatedByAnUser: IIntegration;
let user: TestUser<IUser>;
let userCredentials: Credentials;
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/07-incoming-integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import { password } from '../../data/user';
import type { TestUser } from '../../data/users.helper';
import { createUser, deleteUser, login } from '../../data/users.helper';

describe('[Incoming Integrations]', function () {
this.retries(0);

describe('[Incoming Integrations]', () => {
let integration: IIntegration;
let integrationCreatedByAnUser: IIntegration;
let user: TestUser<IUser>;
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/08-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { before, describe, it, after } from 'mocha';
import { getCredentials, api, request, credentials } from '../../data/api-data';
import { updateSetting } from '../../data/permissions.helper';

describe('[Settings]', function () {
this.retries(0);

describe('[Settings]', () => {
before((done) => getCredentials(done));

describe('[/settings.public]', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/09-rooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ const drawioURL = './tests/e2e/fixtures/files/diagram.drawio';
const svgLogoURL = './public/images/logo/logo.svg';
const svgLogoFileName = 'logo.svg';

describe('[Rooms]', function () {
this.retries(0);

describe('[Rooms]', () => {
before((done) => getCredentials(done));

it('/rooms.get', (done) => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/10-subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import { adminUsername } from '../../data/user';
import type { TestUser } from '../../data/users.helper';
import { createUser, deleteUser, login } from '../../data/users.helper';

describe('[Subscriptions]', function () {
this.retries(0);

describe('[Subscriptions]', () => {
before((done) => getCredentials(done));

let testChannel: IRoom;
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/11-permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { before, describe, it, after } from 'mocha';
import { getCredentials, api, request, credentials } from '../../data/api-data';
import { updatePermission } from '../../data/permissions.helper';

describe('[Permissions]', function () {
this.retries(0);

describe('[Permissions]', () => {
before((done) => getCredentials(done));

after(() => updatePermission('add-oauth-service', ['admin']));
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/12-emoji-custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import { before, describe, it, after } from 'mocha';
import { getCredentials, api, request, credentials } from '../../data/api-data';
import { imgURL } from '../../data/interactions';

describe('[EmojiCustom]', function () {
describe('[EmojiCustom]', () => {
const customEmojiName = `my-custom-emoji-${Date.now()}`;

let withoutAliases: ICustomEmojiDescriptor;

this.retries(0);

before((done) => getCredentials(done));

after(() =>
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/14-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { getCredentials, api, request, credentials } from '../../data/api-data';
import { imgURL } from '../../data/interactions';
import { updatePermission } from '../../data/permissions.helper';

describe('[Assets]', function () {
this.retries(0);

describe('[Assets]', () => {
before((done) => getCredentials(done));

before(() => updatePermission('manage-assets', ['admin']));
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/16-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import { password } from '../../data/user';
import type { TestUser } from '../../data/users.helper';
import { createUser, deleteUser, login } from '../../data/users.helper';

describe('[Commands]', function () {
this.retries(0);

describe('[Commands]', () => {
before((done) => getCredentials(done));

describe('[/commands.get]', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/17-custom-sounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import { before, describe, it, after } from 'mocha';

import { getCredentials, api, request, credentials } from '../../data/api-data';

describe('[CustomSounds]', function () {
this.retries(0);

describe('[CustomSounds]', () => {
before((done) => getCredentials(done));

describe('[/custom-sounds.list]', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/17-custom-user-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { before, describe, it } from 'mocha';

import { getCredentials, api, request, credentials } from '../../data/api-data';

describe('[CustomUserStatus]', function () {
this.retries(0);

describe('[CustomUserStatus]', () => {
before((done) => getCredentials(done));

describe('[/custom-user-status.list]', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/17-webdav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { before, describe, it } from 'mocha';

import { getCredentials, api, request, credentials } from '../../data/api-data';

describe('[Webdav]', function () {
this.retries(0);

describe('[Webdav]', () => {
before((done) => getCredentials(done));

describe('/webdav.getMyAccounts', () => {
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/end-to-end/api/18-oauthapps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { before, describe, it, after } from 'mocha';
import { getCredentials, api, request, credentials } from '../../data/api-data';
import { updatePermission } from '../../data/permissions.helper';

describe('[OAuthApps]', function () {
describe('[OAuthApps]', () => {
const createdAppsIds: IOAuthApps['_id'][] = [];
this.retries(0);

before((done) => getCredentials(done));

Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/19-statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { before, describe, it, after } from 'mocha';
import { getCredentials, api, request, credentials } from '../../data/api-data';
import { updatePermission } from '../../data/permissions.helper';

describe('[Statistics]', function () {
this.retries(0);

describe('[Statistics]', () => {
before((done) => getCredentials(done));

after(() => updatePermission('view-statistics', ['admin']));
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/end-to-end/api/20-licenses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { password } from '../../data/user';
import type { TestUser } from '../../data/users.helper';
import { createUser, deleteUser, login } from '../../data/users.helper';

describe('licenses', function () {
describe('licenses', () => {
let createdUser: TestUser<IUser>;
this.retries(0);

before((done) => getCredentials(done));
let unauthorizedUserCredentials: Credentials;
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/21-banners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { before, describe, it } from 'mocha';

import { getCredentials, api, request, credentials } from '../../data/api-data';

describe('banners', function () {
this.retries(0);

describe('banners', () => {
before((done) => getCredentials(done));

describe('[/banners.getNew]', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/22-push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { before, describe, it, after } from 'mocha';
import { getCredentials, api, request, credentials } from '../../data/api-data';
import { updateSetting } from '../../data/permissions.helper';

describe('[Push]', function () {
this.retries(0);

describe('[Push]', () => {
before((done) => getCredentials(done));

describe('POST [/push.token]', () => {
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/end-to-end/api/23-invites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import { before, describe, it } from 'mocha';

import { getCredentials, api, request, credentials } from '../../data/api-data';

describe('Invites', function () {
describe('Invites', () => {
let testInviteID: IInvite['_id'];
this.retries(0);

before((done) => getCredentials(done));
describe('POST [/findOrCreateInvite]', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/24-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import type { TestUser } from '../../data/users.helper';
import { createUser, deleteUser, login } from '../../data/users.helper';
import { IS_EE } from '../../e2e/config/constants';

describe('Meteor.methods', function () {
this.retries(0);

describe('Meteor.methods', () => {
before((done) => getCredentials(done));

describe('[@getThreadMessages]', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/26-LDAP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import type { Response } from 'supertest';

import { getCredentials, api, request, credentials } from '../../data/api-data';

describe('LDAP', function () {
this.retries(0);

describe('LDAP', () => {
before((done) => getCredentials(done));

describe('[/ldap.syncNow]', () => {
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/27-moderation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ const reportUser = (userId: string, reason: string) => makeModerationApiRequest(

const getUsersReports = (userId: string) => makeModerationApiRequest('moderation.user.reportsByUserId', 'get', { userId });

describe('[Moderation]', function () {
this.retries(0);

describe('[Moderation]', () => {
before((done) => getCredentials(done));

describe('[/moderation.reportsByUsers]', () => {
Expand Down
3 changes: 1 addition & 2 deletions apps/meteor/tests/end-to-end/api/27-presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import { updatePermission } from '../../data/permissions.helper';
import { password } from '../../data/user';
import { createUser, deleteUser, login } from '../../data/users.helper';

describe('[Presence]', function () {
describe('[Presence]', () => {
let createdUser: any;
this.retries(0);

before((done) => getCredentials(done));

Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/28-roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import type { Response } from 'supertest';

import { getCredentials, api, request, credentials } from '../../data/api-data';

describe('[Roles]', function () {
this.retries(0);

describe('[Roles]', () => {
const isEnterprise = Boolean(process.env.IS_EE);

before((done) => getCredentials(done));
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/29-oauth-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import type { Response } from 'supertest';

import { getCredentials, api, request, credentials } from '../../data/api-data';

describe('[OAuth Server]', function () {
this.retries(0);

describe('[OAuth Server]', () => {
let oAuthAppId: string;
let clientId: string;
let clientSecret: string;
Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/30-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { getCredentials, api, request, credentials } from '../../data/api-data';
import { password } from '../../data/user';
import { createUser, deleteUser, login } from '../../data/users.helper';

describe('[Calendar Events]', function () {
this.retries(0);

describe('[Calendar Events]', () => {
let user2: IUser;
let userCredentials: Credentials;

Expand Down
4 changes: 1 addition & 3 deletions apps/meteor/tests/end-to-end/api/31-failed-login-attempts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import { password } from '../../data/user';
import type { TestUser } from '../../data/users.helper';
import { createUser, deleteUser } from '../../data/users.helper';

describe('[Failed Login Attempts]', function () {
this.retries(0);

describe('[Failed Login Attempts]', () => {
const maxAttemptsByUser = 2;
const maxAttemptsByIp = 4;
const userBlockSeconds = 3;
Expand Down
Loading

0 comments on commit 191e534

Please sign in to comment.