Skip to content
Snippets Groups Projects
Commit a4d25ec9 authored by joel.vonderwe's avatar joel.vonderwe Committed by michael.minelli
Browse files

Add allowSonarFailure

parent cd789d8c
Branches
No related tags found
No related merge requests found
......@@ -314,12 +314,17 @@ class AssignmentValidator {
const runSuccess = SonarAnalyzer.runAnalysis(this.assignment.sonarKey, this.assignment.language, this.assignmentFile.buildLine);
if ( runSuccess ) {
this.emitError(`Sonar gate failed`, 'Sonar analysis failure', AssignmentCheckerError.SONAR_ANALYSIS_FAILED);
throw new Error();
if ( !this.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