Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68903

Frontend lint violations do not fail the build

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • core
    • None

      In JENKINS-68887 teilo observed that a new linter violation had been introduced in https://github.com/jenkinsci/jenkins/pull/6538 (only affecting Windows builds). We would have expected the Windows PR build to fail and prevent the PR from being merged, but the Windows PR build passed and the PR was merged. Looking at the build more closely, our CI build sets -Dmaven.test.failure.ignore in order for Maven tests to not halt execution. We rely on Maven tests to halt the build on a fatal error (FAILURE) but to proceed when test failures occur and outputt junit.xml test reports which are then used to mark the build as UNSTABLE in the Jenkins UI. The frontend linter is not cooperating with this design, because it observes the -Dmaven.test.failure.ignore option and proceeds when failures occur, but it does not output junit.xml files.

      This could be fixed by adding stylelint-junit-formatter to the build, which would produce JUnit files for the CSS linter. Alternatively, <testFailureIgnore>false</testFailureIgnore> could be added to the frontend-maven-plugin configuration for the linter, which would fail the build instead of proceeding. Either way, we would achieve the desired outcome: the Jenkins build in the UI would be marked UNSTABLE (with the JUnit formatter) or FAILURE (with <testFailureIgnore>false</testFailureIgnore>). The JUnit implementation is more attractive because it displays the test failures in the Jenkins UI.

      One impediment to fixing this problem is that it would expose a variety of existing linter errors.

            notmyfault Alexander Brandes
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: