@@ -19,6 +19,7 @@ import { countFiles, FileTracker } from './fileTracker';
19
19
20
20
use ( chaiEach ) ;
21
21
22
+ const SOQL_QUERY_LIMIT = 50_000 ;
22
23
/**
23
24
* Assertions is a class that is designed to encapsulate common assertions we want to
24
25
* make during NUT testings
@@ -397,10 +398,7 @@ export class Assertions {
397
398
398
399
private async retrieveSourceMembers ( globs : string [ ] , ignore : string [ ] = [ ] ) : Promise < SourceMember [ ] > {
399
400
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 } ` ) ;
404
402
const all = await this . doGlob ( globs ) ;
405
403
const ignoreFiles = await this . doGlob ( ignore , false ) ;
406
404
const toTrack = all . filter ( ( file ) => ! ignoreFiles . includes ( file ) ) ;
@@ -426,13 +424,13 @@ export class Assertions {
426
424
427
425
private async retrieveApexTestResults ( ) : Promise < ApexTestResult [ ] > {
428
426
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 } ` ) ;
430
428
return result ?. records || [ ] ;
431
429
}
432
430
433
431
private async retrieveApexClasses ( classNames ?: string [ ] ) : Promise < ApexClass [ ] > {
434
432
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 } ` ) ;
436
434
const records = result ?. records || [ ] ;
437
435
return classNames ? records . filter ( ( r ) => classNames . includes ( r . Name ) ) : records ;
438
436
}
0 commit comments