dockerfile_lint icon indicating copy to clipboard operation
dockerfile_lint copied to clipboard

Fix Junit Warning/Info

Open julienhuon opened this issue 3 years ago • 0 comments

Hi,

When you're using the JUnit output, INFOs are displayed as WARNINGs and the WARNINGs as INFOs.

Here an example.

The Dockerfile:

FROM node:12

LABEL Name='test'
LABEL Version='1.0'

The classical output:

# Analyzing Dockerfile


--------INFO---------

INFO: There is no 'EXPOSE' instruction. Without exposed ports how will the service of the container be accessed?. 
Reference -> https://docs.docker.com/engine/reference/builder/#expose


INFO: There is no 'CMD' instruction. None. 
Reference -> https://docs.docker.com/engine/reference/builder/#cmd

The Junit ouput:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="dockerfile_lint" tests="2" failures="2" errors="0" skipped="0">
    <testcase classname="WARNING" name="There is no 'EXPOSE' instruction">
      <failure message="There is no 'EXPOSE' instruction. Without exposed ports how will the service of the container be accessed? | Reference -> https://docs.docker.com/engine/reference/builder/#expose"/>
    </testcase>
    <testcase classname="WARNING" name="There is no 'CMD' instruction">
      <failure message="There is no 'CMD' instruction. None | Reference -> https://docs.docker.com/engine/reference/builder/#cmd"/>
    </testcase>
  </testsuite>
</testsuites>

This PR fixes the problem.

Regards, Julien

julienhuon avatar Oct 15 '21 14:10 julienhuon