Skip to content

Commit 5854728

Browse files
committed
fix: remove autofetch queries that were set to 50k
1 parent bb48b0d commit 5854728

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/assertions.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { countFiles, FileTracker } from './fileTracker';
1919

2020
use(chaiEach);
2121

22+
const SOQL_QUERY_LIMIT = 50_000;
2223
/**
2324
* Assertions is a class that is designed to encapsulate common assertions we want to
2425
* make during NUT testings
@@ -397,10 +398,7 @@ export class Assertions {
397398

398399
private async retrieveSourceMembers(globs: string[], ignore: string[] = []): Promise<SourceMember[]> {
399400
const query = 'SELECT Id,MemberName,MemberType,RevisionCounter FROM SourceMember';
400-
const result = await this.connection?.tooling.query<SourceMember>(query, {
401-
autoFetch: true,
402-
maxFetch: 50000,
403-
});
401+
const result = await this.connection?.tooling.query<SourceMember>(`${query} limit ${SOQL_QUERY_LIMIT}`);
404402
const all = await this.doGlob(globs);
405403
const ignoreFiles = await this.doGlob(ignore, false);
406404
const toTrack = all.filter((file) => !ignoreFiles.includes(file));
@@ -426,13 +424,13 @@ export class Assertions {
426424

427425
private async retrieveApexTestResults(): Promise<ApexTestResult[]> {
428426
const query = 'SELECT TestTimestamp, ApexClassId FROM ApexTestResult';
429-
const result = await this.connection?.tooling.query<ApexTestResult>(query, { autoFetch: true, maxFetch: 50000 });
427+
const result = await this.connection?.tooling.query<ApexTestResult>(`${query} limit ${SOQL_QUERY_LIMIT}`);
430428
return result?.records || [];
431429
}
432430

433431
private async retrieveApexClasses(classNames?: string[]): Promise<ApexClass[]> {
434432
const query = 'SELECT Name,Id FROM ApexClass';
435-
const result = await this.connection?.tooling.query<ApexClass>(query, { autoFetch: true, maxFetch: 50000 });
433+
const result = await this.connection?.tooling.query<ApexClass>(`${query} limit ${SOQL_QUERY_LIMIT}`);
436434
const records = result?.records || [];
437435
return classNames ? records.filter((r) => classNames.includes(r.Name)) : records;
438436
}

src/executionLog.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ export class ExecutionLog {
5757

5858
private async querySourceMembers(): Promise<SourceMember[]> {
5959
const query = 'SELECT Id,MemberName,MemberType,RevisionCounter FROM SourceMember';
60-
const result = await this.context.connection?.tooling.query<SourceMember>(query, {
61-
autoFetch: true,
62-
maxFetch: 50000,
63-
});
60+
const result = await this.context.connection?.tooling.query<SourceMember>(`${query} limit 50000`);
6461
return result?.records || [];
6562
}
6663
}

0 commit comments

Comments
 (0)