Interview Prep/Jenkins/Declarative pipeline syntax

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]]
All Jenkins questions Roadmap: Jenkins

More on Declarative pipeline syntax