Skip to content

Commit 474ea33

Browse files
authored
fix(cli-repl,shell-api): skip/fix tests for latest server alpha (#1446)
- Skip FLE tests on 7.x until MONGOSH-1410 - Skip sharding auto-splitter tests entirely after the removal in 7.0 - Make the code in an `after` hook pass if the before hook never ran - Fix the `collStats` compatibility code in the timeseries case (since now the agg pipeline variant works on timeseries collections in 7.1+)
1 parent c8ddee2 commit 474ea33

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

packages/cli-repl/test/e2e-banners.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ describe('e2e startup banners', () => {
3030
});
3131

3232
after(() => {
33-
freeMonitoringHttpServer.close();
33+
// eslint-disable-next-line chai-friendly/no-unused-expressions
34+
freeMonitoringHttpServer?.close?.();
3435
});
3536

3637
context('without special configuration', () => {

packages/cli-repl/test/e2e-fle.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ describe('FLE tests', () => {
301301

302302
context('6.0+', () => {
303303
skipIfServerVersion(testServer, '< 6.0'); // Queryable Encryption only available on 6.0+
304+
skipIfServerVersion(testServer, '> 6.x'); // TODO(MONGOSH-1410): Queryable Encryption made a breaking change for 7.0
304305

305306
it('allows explicit encryption with bypassQueryAnalysis', async function() {
306307
if (isMacosTooOldForQE()) {
@@ -505,6 +506,7 @@ describe('FLE tests', () => {
505506

506507
context('6.2+', () => {
507508
skipIfServerVersion(testServer, '< 6.2'); // Range QE only available on 6.2+
509+
skipIfServerVersion(testServer, '> 6.x'); // TODO(MONGOSH-1410): Queryable Encryption made a breaking change for 7.0
508510

509511
it('allows explicit range encryption with bypassQueryAnalysis', async function() {
510512
if (isMacosTooOldForQE()) {

packages/shell-api/src/collection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,7 @@ export default class Collection extends ShellApiWithMongoClass {
16151615

16161616
try {
16171617
result.sharded = !!(await config.getCollection('collections').findOne({
1618-
_id: ns,
1618+
_id: timeseriesBucketsNs ?? ns,
16191619
// Dropped is gone on newer server versions, so check for !== true
16201620
// rather than for === false (SERVER-51880 and related).
16211621
dropped: { $ne: true }

packages/shell-api/src/shard.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,7 @@ describe('Shard', () => {
13211321
});
13221322
});
13231323
describe('autosplit', () => {
1324+
skipIfServerVersion(mongos, '> 6.x'); // Auto-splitter is removed in 7.0
13241325
it('disables correctly', async() => {
13251326
expect((await sh.disableAutoSplit()).acknowledged).to.equal(true);
13261327
expect((await sh.status()).value.autosplit['Currently enabled']).to.equal('no');

0 commit comments

Comments
 (0)