Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ 14.1 logging output in xml

We use slf4j with logback, when running from the command line this still works as expected but within intellij it's different.

Running junit tests using gradle in intellij, log output is in the following xml format:

<ijLog><event type='afterSuite'><ijLogEol/>
  <test id='root' parentId=''><ijLogEol/>
    <descriptor name='Test Run' className='' /><ijLogEol/>
    <result resultType='SUCCESS' startTime='1427264227574' endTime='1427264315052'><ijLogEol/>
      <failureType>error</failureType><ijLogEol/>
    </result><ijLogEol/>
  </test><ijLogEol/>
</event></ijLog>

I don't want the IDE to change anything, just use the logging that we've provided. This use to work fine, but since 14.1 i'm having this issue.

like image 502
martin treurnicht Avatar asked Mar 25 '15 12:03

martin treurnicht


4 Answers

A gradle refresh fixed this issue for me.

like image 80
Broonix Avatar answered Nov 04 '22 15:11

Broonix


Bug in Intellij. See here: https://youtrack.jetbrains.com/issue/IDEA-151866 The gradle plugin will generate Intellij specific xml output whenever a test is run (task instance of Test), but Intellij will only interpret the test output as xml when one of the tasks is "test" (hardcoded value). One way to work around the problem: add a tasks test, even if that won't do anything. eg. cleanTest integTest test to run integTest

like image 2
leblonk Avatar answered Nov 04 '22 16:11

leblonk


This issue appeared to me in IntelliJ IDEA 2016.2.3 with Gradle 3.0

I was able to resolve this by gradle refresh + clean, output again started coming in normal format for integration tests.

like image 5
Munish Chandel Avatar answered Nov 04 '22 15:11

Munish Chandel


This worked for me in IntelliJ Idea: 1) Edit your run configuration 2) From your script parameters option remove '--tests *'

like image 1
stacker Avatar answered Nov 04 '22 17:11

stacker