From dd37911411865dd5327e5a697c8ec09150d3fdb5 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Mon, 8 Jul 2024 09:12:58 -0500 Subject: [PATCH 01/16] test: Find duplicate specs and analyze slow tests --- spec/CloudCode.Validator.spec.js | 23 +---------------------- spec/CloudCode.spec.js | 1 + spec/ParseFile.spec.js | 24 ------------------------ spec/ParseLiveQueryServer.spec.js | 29 ----------------------------- spec/PostgresStorageAdapter.spec.js | 2 +- spec/PushWorker.spec.js | 2 +- spec/helper.js | 4 ++++ spec/support/CurrentSpecReporter.js | 26 ++++++++++++++++++++++++-- 8 files changed, 32 insertions(+), 79 deletions(-) diff --git a/spec/CloudCode.Validator.spec.js b/spec/CloudCode.Validator.spec.js index 196568f763..f9e7a44c82 100644 --- a/spec/CloudCode.Validator.spec.js +++ b/spec/CloudCode.Validator.spec.js @@ -194,27 +194,6 @@ describe('cloud validator', () => { }); }); - it('set params on cloud functions', done => { - Parse.Cloud.define( - 'hello', - () => { - return 'Hello world!'; - }, - { - fields: ['a'], - } - ); - Parse.Cloud.run('hello', {}) - .then(() => { - fail('function should have failed.'); - }) - .catch(error => { - expect(error.code).toEqual(Parse.Error.VALIDATION_ERROR); - expect(error.message).toEqual('Validation failed. Please specify data for a.'); - done(); - }); - }); - it('allow params on cloud functions', done => { Parse.Cloud.define( 'hello', @@ -1629,7 +1608,7 @@ describe('cloud validator', () => { } }); - it('Logs on invalid config', () => { + it('Logs on multiple invalid configs', () => { const fields = [ { field: 'otherKey', diff --git a/spec/CloudCode.spec.js b/spec/CloudCode.spec.js index fcfeba416b..6480771956 100644 --- a/spec/CloudCode.spec.js +++ b/spec/CloudCode.spec.js @@ -49,6 +49,7 @@ describe('Cloud Code', () => { }); it('cloud code must be valid type', async () => { + spyOn(console, 'error').and.callFake(() => {}); await expectAsync(reconfigureServer({ cloud: true })).toBeRejectedWith( "argument 'cloud' must either be a string or a function" ); diff --git a/spec/ParseFile.spec.js b/spec/ParseFile.spec.js index c7c58f8ad5..f70db99264 100644 --- a/spec/ParseFile.spec.js +++ b/spec/ParseFile.spec.js @@ -842,30 +842,6 @@ describe('Parse.File testing', () => { expect(file.headers['content-range']).toBe('bytes 0-1212/1212'); }); - it('supports bytes range if end is greater than size', async () => { - const headers = { - 'Content-Type': 'application/octet-stream', - 'X-Parse-Application-Id': 'test', - 'X-Parse-REST-API-Key': 'rest', - }; - const response = await request({ - method: 'POST', - headers: headers, - url: 'http://localhost:8378/1//files/file.txt ', - body: repeat('argle bargle', 100), - }); - const b = response.data; - const file = await request({ - url: b.url, - headers: { - 'Content-Type': 'application/octet-stream', - 'X-Parse-Application-Id': 'test', - Range: 'bytes=0-2000', - }, - }).catch(e => e); - expect(file.headers['content-range']).toBe('bytes 0-1212/1212'); - }); - it('supports bytes range with 0 length', async () => { const headers = { 'Content-Type': 'application/octet-stream', diff --git a/spec/ParseLiveQueryServer.spec.js b/spec/ParseLiveQueryServer.spec.js index 04fb3fff58..9961b2503d 100644 --- a/spec/ParseLiveQueryServer.spec.js +++ b/spec/ParseLiveQueryServer.spec.js @@ -1633,35 +1633,6 @@ describe('ParseLiveQueryServer', function () { }); }); - it('matches CLP when find is restricted to userIds', done => { - const parseLiveQueryServer = new ParseLiveQueryServer({}); - const acl = new Parse.ACL(); - acl.setReadAccess(testUserId, true); - // Mock sessionTokenCache will return false when sessionToken is undefined - const client = { - sessionToken: 'sessionToken', - getSubscriptionInfo: jasmine.createSpy('getSubscriptionInfo').and.returnValue({ - sessionToken: 'userId', - }), - }; - const requestId = 0; - - parseLiveQueryServer - ._matchesCLP( - { - find: { userId: true }, - }, - { className: 'Yolo' }, - client, - requestId, - 'find' - ) - .then(isMatched => { - expect(isMatched).toBe(true); - done(); - }); - }); - it('matches CLP when find is restricted to userIds', done => { const parseLiveQueryServer = new ParseLiveQueryServer({}); const acl = new Parse.ACL(); diff --git a/spec/PostgresStorageAdapter.spec.js b/spec/PostgresStorageAdapter.spec.js index a43ceb6662..aa5e692fe4 100644 --- a/spec/PostgresStorageAdapter.spec.js +++ b/spec/PostgresStorageAdapter.spec.js @@ -362,7 +362,7 @@ describe_only_db('postgres')('PostgresStorageAdapter', () => { await dropTable(client, tableName); }); - it('should use index for caseInsensitive query', async () => { + it('should use index for caseInsensitive query with user', async () => { await adapter.deleteAllClasses(); const config = Config.get('test'); config.schemaCache.clear(); diff --git a/spec/PushWorker.spec.js b/spec/PushWorker.spec.js index 63e0945110..5e57eb8827 100644 --- a/spec/PushWorker.spec.js +++ b/spec/PushWorker.spec.js @@ -120,7 +120,7 @@ describe('PushWorker', () => { }); }); - it('transforms body appropriately', () => { + it('transforms body appropriately with title locale', () => { const cleanBody = PushUtils.transformPushBodyForLocale( { data: { diff --git a/spec/helper.js b/spec/helper.js index d9ced55ede..91c5cf04b1 100644 --- a/spec/helper.js +++ b/spec/helper.js @@ -285,6 +285,10 @@ afterEach(function (done) { .then(afterLogOut); }); +afterAll(() => { + global.displaySlowTests(); +}); + const TestObject = Parse.Object.extend({ className: 'TestObject', }); diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index 3158e21eae..b3f7b7aa79 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -1,15 +1,37 @@ // Sets a global variable to the current test spec // ex: global.currentSpec.description - +const { performance } = require('perf_hooks'); global.currentSpec = null; +const timerMap = {}; + class CurrentSpecReporter { specStarted(spec) { + if (timerMap[spec.fullName]) { + console.log('Duplicate spec: ' + spec.fullName); + } + timerMap[spec.fullName] = performance.now(); global.currentSpec = spec; } - specDone() { + specDone(result) { + if (result.status === 'excluded') { + delete timerMap[result.fullName]; + return; + } + timerMap[result.fullName] = (performance.now() - timerMap[result.fullName]) / 1000; global.currentSpec = null; } } +global.displaySlowTests = function() { + console.log('Showing slowest tests:'); + const times = Object.values(timerMap).sort((a,b) => b - a); + times.forEach((time) => { + // Show test taking longer than 2 second + if (time > 2) { + console.warn(Object.keys(timerMap).find(key => timerMap[key] === time), `${time.toFixed(3)}s`); + } + }); + console.log('\n'); +}; module.exports = CurrentSpecReporter; From a77d341d805451fea4a134a75d8beeff178e68e1 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Mon, 8 Jul 2024 19:27:41 -0500 Subject: [PATCH 02/16] remove timeout --- spec/ParseLiveQuery.spec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/ParseLiveQuery.spec.js b/spec/ParseLiveQuery.spec.js index 22e0918d1b..ef6e017065 100644 --- a/spec/ParseLiveQuery.spec.js +++ b/spec/ParseLiveQuery.spec.js @@ -382,7 +382,6 @@ describe('ParseLiveQuery', function () { await obj2.save(); obj2.set('foo', 'bart'); await obj2.save(); - await sleep(2000); expect(createSpy).toHaveBeenCalledTimes(1); expect(updateSpy).toHaveBeenCalledTimes(1); }); From f471e95d3408994c3c1a321ce9eb6019c8e471d1 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Mon, 8 Jul 2024 19:48:57 -0500 Subject: [PATCH 03/16] output duplicates --- .nvmrc | 3 +-- spec/support/CurrentSpecReporter.js | 9 ++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.nvmrc b/.nvmrc index 43708bb6b4..9075659573 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1,2 +1 @@ -10.14.2 - +20.15.0 diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index b3f7b7aa79..0dd08f07ff 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -4,11 +4,13 @@ const { performance } = require('perf_hooks'); global.currentSpec = null; const timerMap = {}; +const duplicates = []; class CurrentSpecReporter { specStarted(spec) { if (timerMap[spec.fullName]) { console.log('Duplicate spec: ' + spec.fullName); + duplicates.push(spec.fullName); } timerMap[spec.fullName] = performance.now(); global.currentSpec = spec; @@ -23,8 +25,10 @@ class CurrentSpecReporter { } } global.displaySlowTests = function() { - console.log('Showing slowest tests:'); const times = Object.values(timerMap).sort((a,b) => b - a); + if (times.length > 0) { + console.log('Showing slowest tests:'); + } times.forEach((time) => { // Show test taking longer than 2 second if (time > 2) { @@ -32,6 +36,9 @@ global.displaySlowTests = function() { } }); console.log('\n'); + duplicates.forEach((spec) => { + console.warn('Duplicate spec: ' + spec); + }); }; module.exports = CurrentSpecReporter; From e6e6841c4a29120ce43e666e2423a5de415540e0 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Mon, 8 Jul 2024 19:59:48 -0500 Subject: [PATCH 04/16] more duplicate tests --- spec/ParseQuery.Aggregate.spec.js | 4 ++-- spec/ParseQuery.hint.spec.js | 32 +++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/spec/ParseQuery.Aggregate.spec.js b/spec/ParseQuery.Aggregate.spec.js index a61305286c..1939c247f4 100644 --- a/spec/ParseQuery.Aggregate.spec.js +++ b/spec/ParseQuery.Aggregate.spec.js @@ -402,7 +402,7 @@ describe('Parse.Query Aggregate testing', () => { }); it_exclude_dbs(['postgres'])( - 'can group by any date field (it does not work if you have dirty data)', // rows in your collection with non date data in the field that is supposed to be a date + 'can group by any date field (it does not work if you have dirty data) (Mongo)', // rows in your collection with non date data in the field that is supposed to be a date done => { const obj1 = new TestObject({ dateField2019: new Date(1990, 11, 1) }); const obj2 = new TestObject({ dateField2019: new Date(1990, 5, 1) }); @@ -440,7 +440,7 @@ describe('Parse.Query Aggregate testing', () => { ); it_only_db('postgres')( - 'can group by any date field (it does not work if you have dirty data)', // rows in your collection with non date data in the field that is supposed to be a date + 'can group by any date field (it does not work if you have dirty data) (Postgres)', // rows in your collection with non date data in the field that is supposed to be a date done => { const obj1 = new TestObject({ dateField2019: new Date(1990, 11, 1) }); const obj2 = new TestObject({ dateField2019: new Date(1990, 5, 1) }); diff --git a/spec/ParseQuery.hint.spec.js b/spec/ParseQuery.hint.spec.js index 7ebffa4d34..1df2bc9c70 100644 --- a/spec/ParseQuery.hint.spec.js +++ b/spec/ParseQuery.hint.spec.js @@ -27,7 +27,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { await TestUtils.destroyAllDataPermanently(false); }); - it_only_mongodb_version('<5.1>=6')('query find with hint string', async () => { + it_only_mongodb_version('<5.1>=6')('query find with hint string (Mongo <5.1>=6)', async () => { const object = new TestObject(); await object.save(); @@ -39,7 +39,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=5.1<6')('query find with hint string', async () => { + it_only_mongodb_version('>=5.1<6')('query find with hint string (Mongo >=5.1<6)', async () => { const object = new TestObject(); await object.save(); @@ -78,7 +78,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.queryPlan.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('<4.4')('query aggregate with hint string', async () => { + it_only_mongodb_version('<4.4')('query aggregate with hint string (Mongo <4.4)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -100,7 +100,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint string', async () => { + it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint string (Mongo >=4.4<5.1)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -124,7 +124,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint string', async () => { + it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint string (Mongo >=5.1<5.2)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -148,7 +148,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=5.2')('query aggregate with hint string', async () => { + it_only_mongodb_version('>=5.2')('query aggregate with hint string (Mongo >=5.2)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -172,7 +172,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('<4.4')('query aggregate with hint object', async () => { + it_only_mongodb_version('<4.4')('query aggregate with hint object (Mongo <4.4)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -192,7 +192,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint object', async () => { + it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint object (Mongo >=4.4<5.1)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -217,7 +217,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint object', async () => { + it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint object (Mongo >=5.1<5.2)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -242,7 +242,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=5.2')('query aggregate with hint object', async () => { + it_only_mongodb_version('>=5.2')('query aggregate with hint object (Mongo >=5.2)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -267,7 +267,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('<5.1>=6')('query find with hint (rest)', async () => { + it_only_mongodb_version('<5.1>=6')('query find with hint (rest) (Mongo <5.1>=6)', async () => { const object = new TestObject(); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -292,7 +292,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=5.1<6')('query find with hint (rest)', async () => { + it_only_mongodb_version('>=5.1<6')('query find with hint (rest) (Mongo >=5.1<6)', async () => { const object = new TestObject(); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -317,7 +317,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.queryPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('<4.4')('query aggregate with hint (rest)', async () => { + it_only_mongodb_version('<4.4')('query aggregate with hint (rest) (Mongo <4.4)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -344,7 +344,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint (rest)', async () => { + it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint (rest) (Mongo >=4.4<5.1)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -377,7 +377,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint (rest)', async () => { + it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint (rest) (Mongo >=5.1<5.2)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -410,7 +410,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=5.2')('query aggregate with hint (rest)', async () => { + it_only_mongodb_version('>=5.2')('query aggregate with hint (rest) (Mongo >=5.2)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); let options = Object.assign({}, masterKeyOptions, { From 4a1f227542b7361cb9ba39153bd82d7d1877422a Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:13:11 +0200 Subject: [PATCH 05/16] Update spec/support/CurrentSpecReporter.js Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com> --- spec/support/CurrentSpecReporter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index 0dd08f07ff..a042ae756c 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -5,6 +5,8 @@ global.currentSpec = null; const timerMap = {}; const duplicates = []; +/** The min. execution time in seconds for a test to be considered slow. */ +const slowTestLimit = 2; class CurrentSpecReporter { specStarted(spec) { From 220b6a57e14374db22e48e42353620eaa7cff7cf Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:13:16 +0200 Subject: [PATCH 06/16] Update spec/support/CurrentSpecReporter.js Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com> --- spec/support/CurrentSpecReporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index a042ae756c..cb6dc7b867 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -33,7 +33,7 @@ global.displaySlowTests = function() { } times.forEach((time) => { // Show test taking longer than 2 second - if (time > 2) { + if (time >= slowTestLimit) { console.warn(Object.keys(timerMap).find(key => timerMap[key] === time), `${time.toFixed(3)}s`); } }); From af66be74b3dd2c088b528553dbe78772821c2331 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:13:20 +0200 Subject: [PATCH 07/16] Update spec/support/CurrentSpecReporter.js Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com> --- spec/support/CurrentSpecReporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index cb6dc7b867..b5026da305 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -29,7 +29,7 @@ class CurrentSpecReporter { global.displaySlowTests = function() { const times = Object.values(timerMap).sort((a,b) => b - a); if (times.length > 0) { - console.log('Showing slowest tests:'); + console.log('Slow tests with execution time >=${slowTestLimit}s:'); } times.forEach((time) => { // Show test taking longer than 2 second From 702608f17acaf2b8e3625db28222a33ea086e0c7 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:13:25 +0200 Subject: [PATCH 08/16] Update spec/support/CurrentSpecReporter.js Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com> --- spec/support/CurrentSpecReporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index b5026da305..990050b383 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -34,7 +34,7 @@ global.displaySlowTests = function() { times.forEach((time) => { // Show test taking longer than 2 second if (time >= slowTestLimit) { - console.warn(Object.keys(timerMap).find(key => timerMap[key] === time), `${time.toFixed(3)}s`); + console.warn(`${time.toFixed(3)}s:, Object.keys(timerMap).find(key => timerMap[key] === time)); } }); console.log('\n'); From be7259409752c932e95fbf71eda993951f83d6af Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:13:49 +0200 Subject: [PATCH 09/16] Update spec/support/CurrentSpecReporter.js Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com> --- spec/support/CurrentSpecReporter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index 990050b383..71d7992137 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -32,7 +32,6 @@ global.displaySlowTests = function() { console.log('Slow tests with execution time >=${slowTestLimit}s:'); } times.forEach((time) => { - // Show test taking longer than 2 second if (time >= slowTestLimit) { console.warn(`${time.toFixed(3)}s:, Object.keys(timerMap).find(key => timerMap[key] === time)); } From a93cb3e2664997e8a40501fc9368da995e98f0e7 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 13:29:34 +0200 Subject: [PATCH 10/16] Update CurrentSpecReporter.js --- spec/support/CurrentSpecReporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index 71d7992137..ca41f47d60 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -33,7 +33,7 @@ global.displaySlowTests = function() { } times.forEach((time) => { if (time >= slowTestLimit) { - console.warn(`${time.toFixed(3)}s:, Object.keys(timerMap).find(key => timerMap[key] === time)); + console.warn(`${time.toFixed(3)}s:`, Object.keys(timerMap).find(key => timerMap[key] === time)); } }); console.log('\n'); From 291c8cbd32afdd84a757f15f34d9750377d6cef6 Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:07:40 +0200 Subject: [PATCH 11/16] Update CurrentSpecReporter.js --- spec/support/CurrentSpecReporter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index ca41f47d60..c966413c23 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -29,11 +29,11 @@ class CurrentSpecReporter { global.displaySlowTests = function() { const times = Object.values(timerMap).sort((a,b) => b - a); if (times.length > 0) { - console.log('Slow tests with execution time >=${slowTestLimit}s:'); + console.log(`Slow tests with execution time >=${slowTestLimit}s:`); } times.forEach((time) => { if (time >= slowTestLimit) { - console.warn(`${time.toFixed(3)}s:`, Object.keys(timerMap).find(key => timerMap[key] === time)); + console.warn(`${time.toFixed(1)}s:`, Object.keys(timerMap).find(key => timerMap[key] === time)); } }); console.log('\n'); From 6504b26b0ad2f3e9692a29f490e92ac319525bbe Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Tue, 9 Jul 2024 09:20:03 -0500 Subject: [PATCH 12/16] remove duplicate tests --- spec/Auth.spec.js | 29 --------------------------- spec/AuthenticationAdaptersV2.spec.js | 10 --------- spec/InstallationsRouter.spec.js | 4 ++-- spec/ParseFile.spec.js | 24 ---------------------- 4 files changed, 2 insertions(+), 65 deletions(-) diff --git a/spec/Auth.spec.js b/spec/Auth.spec.js index 9f10cf781e..4284c7365b 100644 --- a/spec/Auth.spec.js +++ b/spec/Auth.spec.js @@ -141,35 +141,6 @@ describe('Auth', () => { expect(userAuth.user.id).toBe(user.id); }); - it('should load auth without a config', async () => { - const user = new Parse.User(); - await user.signUp({ - username: 'hello', - password: 'password', - }); - expect(user.getSessionToken()).not.toBeUndefined(); - const userAuth = await getAuthForSessionToken({ - sessionToken: user.getSessionToken(), - }); - expect(userAuth.user instanceof Parse.User).toBe(true); - expect(userAuth.user.id).toBe(user.id); - }); - - it('should load auth with a config', async () => { - const user = new Parse.User(); - await user.signUp({ - username: 'hello', - password: 'password', - }); - expect(user.getSessionToken()).not.toBeUndefined(); - const userAuth = await getAuthForSessionToken({ - sessionToken: user.getSessionToken(), - config: Config.get('test'), - }); - expect(userAuth.user instanceof Parse.User).toBe(true); - expect(userAuth.user.id).toBe(user.id); - }); - describe('getRolesForUser', () => { const rolesNumber = 100; diff --git a/spec/AuthenticationAdaptersV2.spec.js b/spec/AuthenticationAdaptersV2.spec.js index e9486187ef..d5aa8a5898 100644 --- a/spec/AuthenticationAdaptersV2.spec.js +++ b/spec/AuthenticationAdaptersV2.spec.js @@ -369,16 +369,6 @@ describe('Auth Adapter features', () => { expect(spy).toHaveBeenCalled(); }); - it('should throw if no triggers found', async () => { - await reconfigureServer({ auth: { wrongAdapter } }); - const user = new Parse.User(); - await expectAsync( - user.save({ authData: { wrongAdapter: { id: 'wrongAdapter' } } }) - ).toBeRejectedWithError( - 'Adapter is not configured. Implement either validateAuthData or all of the following: validateSetUp, validateLogin and validateUpdate' - ); - }); - it('should throw if policy does not match one of default/solo/additional', async () => { const adapterWithBadPolicy = { validateAppId: () => Promise.resolve(), diff --git a/spec/InstallationsRouter.spec.js b/spec/InstallationsRouter.spec.js index 8e5a80c135..7b6b73e1e5 100644 --- a/spec/InstallationsRouter.spec.js +++ b/spec/InstallationsRouter.spec.js @@ -129,7 +129,7 @@ describe('InstallationsRouter', () => { }); }); - it_exclude_dbs(['postgres'])('query installations with count = 1', done => { + it_exclude_dbs(['postgres'])('query installations with count = 1 (Mongo)', done => { const config = Config.get('test'); const androidDeviceRequest = { installationId: '12345678-abcd-abcd-abcd-123456789abc', @@ -166,7 +166,7 @@ describe('InstallationsRouter', () => { }); }); - it_only_db('postgres')('query installations with count = 1', async () => { + it_only_db('postgres')('query installations with count = 1 (Postgres)', async () => { const config = Config.get('test'); const androidDeviceRequest = { installationId: '12345678-abcd-abcd-abcd-123456789abc', diff --git a/spec/ParseFile.spec.js b/spec/ParseFile.spec.js index f70db99264..1624007e0d 100644 --- a/spec/ParseFile.spec.js +++ b/spec/ParseFile.spec.js @@ -771,30 +771,6 @@ describe('Parse.File testing', () => { expect(file.headers['content-range']).toBe('bytes 100-1212/1212'); }); - it('supports bytes range if start and end undefined', async () => { - const headers = { - 'Content-Type': 'application/octet-stream', - 'X-Parse-Application-Id': 'test', - 'X-Parse-REST-API-Key': 'rest', - }; - const response = await request({ - method: 'POST', - headers: headers, - url: 'http://localhost:8378/1//files/file.txt ', - body: repeat('argle bargle', 100), - }); - const b = response.data; - const file = await request({ - url: b.url, - headers: { - 'Content-Type': 'application/octet-stream', - 'X-Parse-Application-Id': 'test', - Range: 'bytes=abc-efs', - }, - }).catch(e => e); - expect(file.headers['content-range']).toBeUndefined(); - }); - it('supports bytes range if start and end undefined', async () => { const headers = { 'Content-Type': 'application/octet-stream', From 4cbf09f7013802e190db2045d10a5d897d37b03f Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Tue, 9 Jul 2024 09:47:07 -0500 Subject: [PATCH 13/16] remove more duplicate tests --- spec/AuthenticationAdapters.spec.js | 27 ++------------------------- spec/MongoStorageAdapter.spec.js | 4 ++-- spec/ParseQuery.hint.spec.js | 4 ++-- 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/spec/AuthenticationAdapters.spec.js b/spec/AuthenticationAdapters.spec.js index ee232887c9..e428c81254 100644 --- a/spec/AuthenticationAdapters.spec.js +++ b/spec/AuthenticationAdapters.spec.js @@ -469,29 +469,6 @@ describe('AuthenticationProviders', function () { expect(providerOptions).toEqual(options.facebook); }); - it('should throw error when Facebook request appId is wrong data type', async () => { - const httpsRequest = require('../lib/Adapters/Auth/httpsRequest'); - spyOn(httpsRequest, 'get').and.callFake(() => { - return Promise.resolve({ id: 'a' }); - }); - const options = { - facebook: { - appIds: 'abcd', - appSecret: 'secret_sauce', - }, - }; - const authData = { - access_token: 'badtoken', - }; - const { adapter, appIds, providerOptions } = authenticationLoader.loadAuthAdapter( - 'facebook', - options - ); - await expectAsync(adapter.validateAppId(appIds, authData, providerOptions)).toBeRejectedWith( - new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'appIds must be an array.') - ); - }); - it('should handle Facebook appSecret for validating appIds', async () => { const httpsRequest = require('../lib/Adapters/Auth/httpsRequest'); spyOn(httpsRequest, 'get').and.callFake(() => { @@ -1652,7 +1629,7 @@ describe('apple signin auth adapter', () => { } }); - it('(using client id as string) should throw error with with invalid jwt issuer', async () => { + it('(using client id as string) should throw error with with invalid jwt issuer with token', async () => { const fakeClaim = { iss: 'https://not.apple.com', sub: 'the_user_id', @@ -2208,7 +2185,7 @@ describe('facebook limited auth adapter', () => { } }); - it('(using client id as string) should throw error with with invalid jwt issuer', async () => { + it('(using client id as string) with token', async () => { const fakeClaim = { iss: 'https://not.facebook.com', sub: 'the_user_id', diff --git a/spec/MongoStorageAdapter.spec.js b/spec/MongoStorageAdapter.spec.js index e7bbfe0cd8..beaf52d54f 100644 --- a/spec/MongoStorageAdapter.spec.js +++ b/spec/MongoStorageAdapter.spec.js @@ -390,7 +390,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { await expectAsync(adapter.getClass('UnknownClass')).toBeRejectedWith(undefined); }); - it_only_mongodb_version('<5.1>=6')('should use index for caseInsensitive query', async () => { + it_only_mongodb_version('<5.1>=6')('should use index for caseInsensitive query (Mongo <5.1>=6)', async () => { const user = new Parse.User(); user.set('username', 'Bugs'); user.set('password', 'Bunny'); @@ -424,7 +424,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { expect(postIndexPlan.executionStats.executionStages.stage).toBe('FETCH'); }); - it_only_mongodb_version('>=5.1<6')('should use index for caseInsensitive query', async () => { + it_only_mongodb_version('>=5.1<6')('should use index for caseInsensitive query (Mongo >=5.1<6)', async () => { const user = new Parse.User(); user.set('username', 'Bugs'); user.set('password', 'Bunny'); diff --git a/spec/ParseQuery.hint.spec.js b/spec/ParseQuery.hint.spec.js index 1df2bc9c70..f168298700 100644 --- a/spec/ParseQuery.hint.spec.js +++ b/spec/ParseQuery.hint.spec.js @@ -50,7 +50,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.queryPlan.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('<5.1>=6')('query find with hint object', async () => { + it_only_mongodb_version('<5.1>=6')('query find with hint object (Mongo <5.1>=6)', async () => { const object = new TestObject(); await object.save(); @@ -64,7 +64,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { }); }); - it_only_mongodb_version('>=5.1<6')('query find with hint object', async () => { + it_only_mongodb_version('>=5.1<6')('query find with hint object (Mongo >=5.1<6)', async () => { const object = new TestObject(); await object.save(); From 2a3ddbeb454e411bcff1edc691f11e7b01e11fb8 Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Tue, 9 Jul 2024 09:55:29 -0500 Subject: [PATCH 14/16] reduce execution time to 1 second --- spec/support/CurrentSpecReporter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index c966413c23..f872ec1059 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -6,7 +6,7 @@ global.currentSpec = null; const timerMap = {}; const duplicates = []; /** The min. execution time in seconds for a test to be considered slow. */ -const slowTestLimit = 2; +const slowTestLimit = 1; class CurrentSpecReporter { specStarted(spec) { From 6ab4d857007bc482620fb6b1170e369f023b368a Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Tue, 9 Jul 2024 10:02:05 -0500 Subject: [PATCH 15/16] change back 2 seconds limit was curious about 1 second --- spec/support/CurrentSpecReporter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/support/CurrentSpecReporter.js b/spec/support/CurrentSpecReporter.js index f872ec1059..1e7f94362d 100755 --- a/spec/support/CurrentSpecReporter.js +++ b/spec/support/CurrentSpecReporter.js @@ -5,8 +5,8 @@ global.currentSpec = null; const timerMap = {}; const duplicates = []; -/** The min. execution time in seconds for a test to be considered slow. */ -const slowTestLimit = 1; +/** The minimum execution time in seconds for a test to be considered slow. */ +const slowTestLimit = 2; class CurrentSpecReporter { specStarted(spec) { From 04c95e53c6fbf6d6d28a4a16c92ec9cd1c1b6c3f Mon Sep 17 00:00:00 2001 From: Diamond Lewis Date: Tue, 9 Jul 2024 18:31:22 -0500 Subject: [PATCH 16/16] revert DB specific tests --- spec/InstallationsRouter.spec.js | 4 ++-- spec/MongoStorageAdapter.spec.js | 4 ++-- spec/ParseQuery.Aggregate.spec.js | 4 ++-- spec/ParseQuery.hint.spec.js | 36 +++++++++++++++---------------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/spec/InstallationsRouter.spec.js b/spec/InstallationsRouter.spec.js index 7b6b73e1e5..8e5a80c135 100644 --- a/spec/InstallationsRouter.spec.js +++ b/spec/InstallationsRouter.spec.js @@ -129,7 +129,7 @@ describe('InstallationsRouter', () => { }); }); - it_exclude_dbs(['postgres'])('query installations with count = 1 (Mongo)', done => { + it_exclude_dbs(['postgres'])('query installations with count = 1', done => { const config = Config.get('test'); const androidDeviceRequest = { installationId: '12345678-abcd-abcd-abcd-123456789abc', @@ -166,7 +166,7 @@ describe('InstallationsRouter', () => { }); }); - it_only_db('postgres')('query installations with count = 1 (Postgres)', async () => { + it_only_db('postgres')('query installations with count = 1', async () => { const config = Config.get('test'); const androidDeviceRequest = { installationId: '12345678-abcd-abcd-abcd-123456789abc', diff --git a/spec/MongoStorageAdapter.spec.js b/spec/MongoStorageAdapter.spec.js index beaf52d54f..e7bbfe0cd8 100644 --- a/spec/MongoStorageAdapter.spec.js +++ b/spec/MongoStorageAdapter.spec.js @@ -390,7 +390,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { await expectAsync(adapter.getClass('UnknownClass')).toBeRejectedWith(undefined); }); - it_only_mongodb_version('<5.1>=6')('should use index for caseInsensitive query (Mongo <5.1>=6)', async () => { + it_only_mongodb_version('<5.1>=6')('should use index for caseInsensitive query', async () => { const user = new Parse.User(); user.set('username', 'Bugs'); user.set('password', 'Bunny'); @@ -424,7 +424,7 @@ describe_only_db('mongo')('MongoStorageAdapter', () => { expect(postIndexPlan.executionStats.executionStages.stage).toBe('FETCH'); }); - it_only_mongodb_version('>=5.1<6')('should use index for caseInsensitive query (Mongo >=5.1<6)', async () => { + it_only_mongodb_version('>=5.1<6')('should use index for caseInsensitive query', async () => { const user = new Parse.User(); user.set('username', 'Bugs'); user.set('password', 'Bunny'); diff --git a/spec/ParseQuery.Aggregate.spec.js b/spec/ParseQuery.Aggregate.spec.js index 1939c247f4..a61305286c 100644 --- a/spec/ParseQuery.Aggregate.spec.js +++ b/spec/ParseQuery.Aggregate.spec.js @@ -402,7 +402,7 @@ describe('Parse.Query Aggregate testing', () => { }); it_exclude_dbs(['postgres'])( - 'can group by any date field (it does not work if you have dirty data) (Mongo)', // rows in your collection with non date data in the field that is supposed to be a date + 'can group by any date field (it does not work if you have dirty data)', // rows in your collection with non date data in the field that is supposed to be a date done => { const obj1 = new TestObject({ dateField2019: new Date(1990, 11, 1) }); const obj2 = new TestObject({ dateField2019: new Date(1990, 5, 1) }); @@ -440,7 +440,7 @@ describe('Parse.Query Aggregate testing', () => { ); it_only_db('postgres')( - 'can group by any date field (it does not work if you have dirty data) (Postgres)', // rows in your collection with non date data in the field that is supposed to be a date + 'can group by any date field (it does not work if you have dirty data)', // rows in your collection with non date data in the field that is supposed to be a date done => { const obj1 = new TestObject({ dateField2019: new Date(1990, 11, 1) }); const obj2 = new TestObject({ dateField2019: new Date(1990, 5, 1) }); diff --git a/spec/ParseQuery.hint.spec.js b/spec/ParseQuery.hint.spec.js index f168298700..7ebffa4d34 100644 --- a/spec/ParseQuery.hint.spec.js +++ b/spec/ParseQuery.hint.spec.js @@ -27,7 +27,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { await TestUtils.destroyAllDataPermanently(false); }); - it_only_mongodb_version('<5.1>=6')('query find with hint string (Mongo <5.1>=6)', async () => { + it_only_mongodb_version('<5.1>=6')('query find with hint string', async () => { const object = new TestObject(); await object.save(); @@ -39,7 +39,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=5.1<6')('query find with hint string (Mongo >=5.1<6)', async () => { + it_only_mongodb_version('>=5.1<6')('query find with hint string', async () => { const object = new TestObject(); await object.save(); @@ -50,7 +50,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.queryPlan.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('<5.1>=6')('query find with hint object (Mongo <5.1>=6)', async () => { + it_only_mongodb_version('<5.1>=6')('query find with hint object', async () => { const object = new TestObject(); await object.save(); @@ -64,7 +64,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { }); }); - it_only_mongodb_version('>=5.1<6')('query find with hint object (Mongo >=5.1<6)', async () => { + it_only_mongodb_version('>=5.1<6')('query find with hint object', async () => { const object = new TestObject(); await object.save(); @@ -78,7 +78,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.queryPlan.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('<4.4')('query aggregate with hint string (Mongo <4.4)', async () => { + it_only_mongodb_version('<4.4')('query aggregate with hint string', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -100,7 +100,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint string (Mongo >=4.4<5.1)', async () => { + it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint string', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -124,7 +124,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint string (Mongo >=5.1<5.2)', async () => { + it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint string', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -148,7 +148,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=5.2')('query aggregate with hint string (Mongo >=5.2)', async () => { + it_only_mongodb_version('>=5.2')('query aggregate with hint string', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -172,7 +172,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('<4.4')('query aggregate with hint object (Mongo <4.4)', async () => { + it_only_mongodb_version('<4.4')('query aggregate with hint object', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -192,7 +192,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint object (Mongo >=4.4<5.1)', async () => { + it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint object', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -217,7 +217,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint object (Mongo >=5.1<5.2)', async () => { + it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint object', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -242,7 +242,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=5.2')('query aggregate with hint object (Mongo >=5.2)', async () => { + it_only_mongodb_version('>=5.2')('query aggregate with hint object', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); @@ -267,7 +267,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('<5.1>=6')('query find with hint (rest) (Mongo <5.1>=6)', async () => { + it_only_mongodb_version('<5.1>=6')('query find with hint (rest)', async () => { const object = new TestObject(); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -292,7 +292,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('>=5.1<6')('query find with hint (rest) (Mongo >=5.1<6)', async () => { + it_only_mongodb_version('>=5.1<6')('query find with hint (rest)', async () => { const object = new TestObject(); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -317,7 +317,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(explain.queryPlanner.winningPlan.queryPlan.inputStage.inputStage.indexName).toBe('_id_'); }); - it_only_mongodb_version('<4.4')('query aggregate with hint (rest) (Mongo <4.4)', async () => { + it_only_mongodb_version('<4.4')('query aggregate with hint (rest)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -344,7 +344,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint (rest) (Mongo >=4.4<5.1)', async () => { + it_only_mongodb_version('>=4.4<5.1')('query aggregate with hint (rest)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -377,7 +377,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint (rest) (Mongo >=5.1<5.2)', async () => { + it_only_mongodb_version('>=5.1<5.2')('query aggregate with hint (rest)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); let options = Object.assign({}, masterKeyOptions, { @@ -410,7 +410,7 @@ describe_only_db('mongo')('Parse.Query hint', () => { expect(queryPlanner.winningPlan.queryPlan.inputStage.inputStage.keyPattern).toEqual({ _id: 1 }); }); - it_only_mongodb_version('>=5.2')('query aggregate with hint (rest) (Mongo >=5.2)', async () => { + it_only_mongodb_version('>=5.2')('query aggregate with hint (rest)', async () => { const object = new TestObject({ foo: 'bar' }); await object.save(); let options = Object.assign({}, masterKeyOptions, {