Skip to content
Snippets Groups Projects
Commit 8957b259 authored by joel.vonderwe's avatar joel.vonderwe
Browse files

Add allowSonarFailure

parent d15be9b1
No related branches found
No related tags found
No related merge requests found
......@@ -301,12 +301,17 @@ class AssignmentValidator {
const runSuccess = SonarAnalyzer.runAnalysis(assignment.sonarKey, assignment.language, assignmentFile.buildLine);
if ( runSuccess ) {
this.emitError(`Sonar gate failed`, 'Sonar analysis failure', AssignmentCheckerError.SONAR_ANALYSIS_FAILED);
return;
if ( !assignment.allowSonarFailure ) {
this.emitError(`Sonar gate failed`, 'Sonar analysis failure', AssignmentCheckerError.SONAR_ANALYSIS_FAILED);
return;
} else {
this.endSubStep('Sonar gate failed, you should check the sonar project', false);
}
} else {
this.endSubStep('Sonar gate passed', false);
}
this.endSubStep('Sonar gate passed', false);
this.endStep('Sonar analysis success', false);
this.endStep('Sonar analysis finished', false);
}
......
......@@ -13,6 +13,7 @@ interface Assignment {
gitlabLastInfoDate: string;
published: boolean;
useSonar: boolean;
allowSonarFailure: boolean;
sonarKey: string;
sonarCreationInfo: SonarProjectCreation;
language: Language;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment