martin treurnicht
martin treurnicht

Reputation: 1253

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.

Upvotes: 22

Views: 2854

Answers (4)

Munish Chandel
Munish Chandel

Reputation: 3702

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.

Upvotes: 5

Broonix
Broonix

Reputation: 1155

A gradle refresh fixed this issue for me.

Upvotes: 22

leblonk
leblonk

Reputation: 197

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

Upvotes: 3

stacker
stacker

Reputation: 21

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

Upvotes: 1

Related Questions