Skip to content

Commit 226e48b

Browse files
fix tests
1 parent 5bc9edb commit 226e48b

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

test/integration/client-side-encryption/driver.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ describe('Client Side Encryption Functional', function () {
225225
let collection: Collection;
226226

227227
beforeEach(async function () {
228-
if (!this.configuration.clientSideEncryption.environmentConfigured) {
228+
if (!this.configuration.clientSideEncryption.enabled) {
229229
return;
230230
}
231231

test/tools/runner/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function convertToConnStringMap(obj: Record<string, any>) {
5757
export class TestConfiguration {
5858
version: string;
5959
clientSideEncryption: {
60-
environmentConfigured: boolean;
60+
enabled: boolean;
6161
mongodbClientEncryption: any;
6262
CSFLE_KMS_PROVIDERS: string | undefined;
6363
version: string;

test/tools/runner/filters/client_encryption_filter.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { Filter } from './filter';
2121

2222
export class ClientSideEncryptionFilter extends Filter {
2323
enabled: boolean;
24-
environmentSetUp: boolean;
2524
static version = null;
2625

2726
override async initializeFilter(client: MongoClient, context: Record<string, any>) {
@@ -43,7 +42,6 @@ export class ClientSideEncryptionFilter extends Filter {
4342
).version;
4443

4544
this.enabled = !!(CSFLE_KMS_PROVIDERS && mongodbClientEncryption);
46-
this.environmentSetUp = !!CSFLE_KMS_PROVIDERS;
4745

4846
// Adds these fields onto the context so that they can be reused by tests
4947
context.clientSideEncryption = {
@@ -74,7 +72,8 @@ export class ClientSideEncryptionFilter extends Filter {
7472
}
7573
const validRange = typeof clientSideEncryption === 'string' ? clientSideEncryption : '>=0.0.0';
7674

77-
if (!this.environmentSetUp) return 'Test requires FLE environment variables..';
75+
if (ClientSideEncryptionFilter.version && !this.enabled)
76+
return 'Test requires FLE environment variables..';
7877
if (!this.enabled) return 'Test requires CSFLE to be enabled.';
7978
return satisfies(ClientSideEncryptionFilter.version, validRange)
8079
? true

test/tools/runner/hooks/configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const testConfigBeforeHook = async function () {
168168
auth: process.env.AUTH === 'auth',
169169
tls: process.env.SSL === 'ssl',
170170
csfle: {
171-
environmentConfigured: this.configuration.clientSideEncryption.environmentConfigured,
171+
enabled: this.configuration.clientSideEncryption.enabled,
172172
version: this.configuration.clientSideEncryption.version
173173
},
174174
serverApi: MONGODB_API_VERSION,

test/tools/unified-spec-runner/unified-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export async function topologySatisfies(
120120

121121
if (typeof r.csfle === 'boolean') {
122122
const versionSupportsCSFLE = semverGte(config.version, '4.2.0');
123-
const csfleEnabled = config.clientSideEncryption.environmentConfigured;
123+
const csfleEnabled = config.clientSideEncryption.enabled;
124124

125125
if (r.csfle) {
126126
ok &&= versionSupportsCSFLE && csfleEnabled;

0 commit comments

Comments
 (0)