@@ -23,7 +23,7 @@ import {
2323 getErrorStack ,
2424} from "./pure/helpers-pure" ;
2525import { QueryMetadata , SortDirection } from "./pure/interface-types" ;
26- import { Logger , ProgressReporter } from "./common" ;
26+ import { BaseLogger , Logger , ProgressReporter } from "./common" ;
2727import { CompilationMessage } from "./pure/legacy-messages" ;
2828import { sarifParser } from "./sarif-parser" ;
2929import { walkDirectory } from "./helpers" ;
@@ -149,6 +149,7 @@ export interface TestCompleted {
149149 compilationMs : number ;
150150 evaluationMs : number ;
151151 expected : string ;
152+ actual ?: string ;
152153 diff : string [ ] | undefined ;
153154 failureDescription ?: string ;
154155 failureStage ?: string ;
@@ -439,14 +440,19 @@ export class CodeQLCliServer implements Disposable {
439440 command : string [ ] ,
440441 commandArgs : string [ ] ,
441442 cancellationToken ?: CancellationToken ,
442- logger ?: Logger ,
443+ logger ?: BaseLogger ,
443444 ) : AsyncGenerator < string , void , unknown > {
444445 // Add format argument first, in case commandArgs contains positional parameters.
445446 const args = [ ...command , "--format" , "jsonz" , ...commandArgs ] ;
446447
447448 // Spawn the CodeQL process
448449 const codeqlPath = await this . getCodeQlPath ( ) ;
449450 const childPromise = spawn ( codeqlPath , args ) ;
451+ // Avoid a runtime message about unhandled rejection.
452+ childPromise . catch ( ( ) => {
453+ /**/
454+ } ) ;
455+
450456 const child = childPromise . childProcess ;
451457
452458 let cancellationRegistration : Disposable | undefined = undefined ;
@@ -497,7 +503,7 @@ export class CodeQLCliServer implements Disposable {
497503 logger,
498504 } : {
499505 cancellationToken ?: CancellationToken ;
500- logger ?: Logger ;
506+ logger ?: BaseLogger ;
501507 } = { } ,
502508 ) : AsyncGenerator < EventType , void , unknown > {
503509 for await ( const event of this . runAsyncCodeQlCliCommandInternal (
@@ -776,7 +782,7 @@ export class CodeQLCliServer implements Disposable {
776782 logger,
777783 } : {
778784 cancellationToken ?: CancellationToken ;
779- logger ?: Logger ;
785+ logger ?: BaseLogger ;
780786 } ,
781787 ) : AsyncGenerator < TestCompleted , void , unknown > {
782788 const subcommandArgs = this . cliConfig . additionalTestArguments . concat ( [
@@ -1661,7 +1667,7 @@ const lineEndings = ["\r\n", "\r", "\n"];
16611667 * @param stream The stream to log.
16621668 * @param logger The logger that will consume the stream output.
16631669 */
1664- async function logStream ( stream : Readable , logger : Logger ) : Promise < void > {
1670+ async function logStream ( stream : Readable , logger : BaseLogger ) : Promise < void > {
16651671 for await ( const line of splitStreamAtSeparators ( stream , lineEndings ) ) {
16661672 // Await the result of log here in order to ensure the logs are written in the correct order.
16671673 await logger . log ( line ) ;
0 commit comments