Skip to content
Snippets Groups Projects
Unverified Commit d3264143 authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

Regression: CI (#26658)


Co-authored-by: default avatarDiego Sampaio <chinello@gmail.com>
parent 00c787f8
No related branches found
No related tags found
No related merge requests found
......@@ -494,7 +494,7 @@ jobs:
cd ./apps/meteor
for i in $(seq 1 5); do
npm run testapi && s=0 && break || s=$?;
IS_EE=true npm run testapi && s=0 && break || s=$?;
docker compose -f ../../docker-compose-ci.yml logs --tail=100
......
......@@ -26,7 +26,7 @@ class ChatMessageCollection extends Mongo.Collection<IMessage & { ignored?: bool
// TODO: check if we can dodge these missing typings from Meteor Collection Hooks
export const ChatMessage = new ChatMessageCollection() as unknown as Mongo.Collection<IMessage & { ignored?: boolean }> & {
direct: Mongo.Collection<IMessage, IMessage>;
direct: Mongo.Collection<Omit<IMessage, '_id'>, IMessage>;
queries: unknown[];
};
......@@ -28,7 +28,7 @@ type ThreadTemplateInstance = Blaze.TemplateInstance<{
}> & {
firstNode: HTMLElement;
Threads: Mongo.Collection<IMessage> & {
direct: Mongo.Collection<IMessage>;
direct: Mongo.Collection<Omit<IMessage, '_id'>, IMessage>;
queries: unknown[];
};
threadsObserve?: Meteor.LiveQueryHandle;
......@@ -170,7 +170,7 @@ Template.thread.helpers({
Template.thread.onCreated(async function (this: ThreadTemplateInstance) {
this.Threads = new Mongo.Collection(null) as Mongo.Collection<IMessage> & {
direct: Mongo.Collection<IMessage>;
direct: Mongo.Collection<Omit<IMessage, '_id'>, IMessage>;
queries: unknown[];
};
......
......@@ -59,7 +59,7 @@ export async function upsertMessage(
);
}
return direct.upsert({ _id }, { $set: messageToUpsert });
return direct.upsert({ _id }, messageToUpsert);
}
export function upsertMessageBulk({ msgs, subscription }: { msgs: IMessage[]; subscription?: ISubscription }, collection = ChatMessage) {
......
......@@ -55,7 +55,7 @@ export class ChatMessages {
constructor(
public collection: Mongo.Collection<IMessage> & {
direct: Mongo.Collection<IMessage>;
direct: Mongo.Collection<Omit<IMessage, '_id'>, IMessage>;
queries: unknown[];
} = ChatMessage,
) {}
......
import { BannerPlatform } from '@rocket.chat/core-typings';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
......@@ -20,14 +21,16 @@ const fetchInitialBanners = async (): Promise<void> => {
if (!user?.username) {
return;
}
setTimeout(() => {
imperativeModal.open({
component: DeviceManagementFeatureModal,
props: {
close: imperativeModal.close,
},
});
}, 2000);
process.env.TEST_MODE &&
setTimeout(() => {
imperativeModal.open({
component: DeviceManagementFeatureModal,
props: {
close: imperativeModal.close,
},
});
}, 2000);
computation.stop();
});
continue;
......@@ -78,6 +81,12 @@ Meteor.startup(() => {
return;
}
FlowRouter.watchPathChange();
if (FlowRouter.getRouteName() === 'setup-wizard') {
return;
}
unwatchBanners = Tracker.nonreactive(watchBanners);
});
});
......@@ -25,6 +25,10 @@ settings.watch('Enterprise_License', (license) => {
return;
}
if (license === process.env.ROCKETCHAT_LICENSE) {
return;
}
if (!addLicense(license)) {
Settings.updateValueById('Enterprise_License_Status', 'Invalid');
return;
......@@ -34,6 +38,8 @@ settings.watch('Enterprise_License', (license) => {
});
if (process.env.ROCKETCHAT_LICENSE) {
addLicense(process.env.ROCKETCHAT_LICENSE);
Meteor.startup(() => {
if (settings.get('Enterprise_License')) {
console.warn(
......
......@@ -124,7 +124,7 @@ describe('licenses', function () {
.expect('Content-Type', 'application/json')
.expect(200)
.expect((res) => {
expect(res.body).to.have.property('isEnterprise', false);
expect(res.body).to.have.property('isEnterprise', Boolean(process.env.IS_EE));
})
.end(done);
});
......@@ -136,7 +136,7 @@ describe('licenses', function () {
.expect('Content-Type', 'application/json')
.expect(200)
.expect((res) => {
expect(res.body).to.have.property('isEnterprise', false);
expect(res.body).to.have.property('isEnterprise', Boolean(process.env.IS_EE));
})
.end(done);
});
......
......@@ -9,7 +9,13 @@ describe('LDAP', function () {
before((done) => getCredentials(done));
describe('[/ldap.syncNow]', () => {
it('should throw an error containing totp-required error ', (done) => {
it('should throw an error containing totp-required error when not running EE', function (done) {
// TODO this is not the right way to do it. We're doing this way for now just because we have separate CI jobs for EE and CE,
// ideally we should have a single CI job that adds a license and runs both CE and EE tests.
if (process.env.IS_EE) {
this.skip();
return;
}
request
.post(api('ldap.syncNow'))
.set(credentials)
......@@ -21,5 +27,22 @@ describe('LDAP', function () {
})
.end(done);
});
it('should throw an error of LDAP disabled when running EE', function (done) {
if (!process.env.IS_EE) {
this.skip();
return;
}
request
.post(api('ldap.syncNow'))
.set(credentials)
.expect('Content-Type', 'application/json')
.expect(400)
.expect((res: Response) => {
expect(res.body).to.have.property('success', false);
expect(res.body).to.have.property('error', 'LDAP_disabled');
})
.end(done);
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment