diff --git a/NodeApp/src/helpers/Dojo/ExerciseRunHelper.ts b/NodeApp/src/helpers/Dojo/ExerciseRunHelper.ts index 49635d05277fa059e87920dade7d613b6b7c9186..90cbd482d67d0fedaab6f5d9e69f8b4b2428db3e 100644 --- a/NodeApp/src/helpers/Dojo/ExerciseRunHelper.ts +++ b/NodeApp/src/helpers/Dojo/ExerciseRunHelper.ts @@ -89,10 +89,10 @@ class ExerciseRunHelper { const validationResults = SharedAssignmentHelper.validateDescriptionFile(path.join(options.path, ClientsSharedConfig.assignment.filename)); if ( !validationResults.isValid ) { - spinner.fail(`The ${ ClientsSharedConfig.assignment.filename } file is invalid: ${ JSON.stringify(validationResults.errors) }`); + spinner.fail(`The ${ ClientsSharedConfig.assignment.filename } file is invalid: ${ validationResults.error }`); return; } else { - assignmentFile = validationResults.results!; + assignmentFile = validationResults.content!; } haveResultsVolume = assignmentFile.result.volume !== undefined; @@ -139,14 +139,18 @@ class ExerciseRunHelper { let spinner: ora.Ora; if ( verbose ) { - let buildPhase: boolean = true; + let buildPhase: boolean | undefined = undefined; exerciseDockerCompose.events.on('logs', (log: string, _error: boolean, displayable: boolean, currentStep: string) => { for ( const line of log.split('\n') ) { - if ( currentStep == 'COMPOSE_RUN' && buildPhase && line != '' && !line.startsWith('#') ) { + if ( displayable && buildPhase == undefined && line.startsWith('#') ) { + buildPhase = true; + } + + if ( currentStep == 'COMPOSE_RUN' && buildPhase === true && line != '' && !line.startsWith('#') ) { buildPhase = false; } - if ( displayable && (options.superVerbose || !buildPhase) ) { + if ( displayable && (options.superVerbose || buildPhase === false) ) { console.log(line); } } @@ -248,11 +252,12 @@ class ExerciseRunHelper { // Step 4: Display results + Volume location { + const info = chalk.magenta.bold.italic; ClientsSharedExerciseHelper.displayExecutionResults(exerciseResultsValidation.exerciseResults!, exerciseDockerCompose.exitCode, { - INFO : chalk.bold, + INFO : info, SUCCESS: chalk.green, FAILURE: chalk.red - }, `\n\n${ chalk.bold('Execution results folder') } : ${ this.folderResultsVolume }`); + }, `\n\n${ info('Execution results folder: ') }${ this.folderResultsVolume }`); } } }