What do `junit` and `recordIssues` do?
BeginnerConceptDeclarative pipeline syntax
Answer
junit 'reports/**/*.xml' parses JUnit XML, shows test trends, and marks the build UNSTABLE if any test failed. recordIssues (Warnings NG plugin) collects static analysis results such as ESLint, Checkstyle or SpotBugs with quality gates.
post { always { junit allowEmptyResults: false, testResults: 'reports/junit.xml' } }
recordIssues tools: [esLint(pattern: 'eslint.xml')], qualityGates: [[threshold: 1, type: 'TOTAL_ERROR', unstable: false]]
More on Declarative pipeline syntax
What is the minimum valid declarative pipeline?BeginnerWhat agent types exist in declarative pipelines?IntermediateWhen do you use `agent none` at the top level?IntermediateHow do nested sequential stages work and why are they useful?IntermediateList the `post` conditions and when each fires.IntermediateWhat are the most useful `when` conditions?Intermediate