This PR sets the <skipped> node's message attribute to the last line of the output from the skipped test.
I've made this change as I came across an issue when trying to integrate this tool with https://github.com/thought-machine/please which only looks at the message attribute of the <skipped> node and not the containing text, so was outputting Skipped as the reason for each skipped test which isn't very helpful.
This seems more the correct behaviour imo since this is how JUnit outputs its XML report:
// AppTest.java
package com.marcuscaisey;
import org.junit.Test;
import org.junit.Ignore;
public class AppTest {
@Test
@Ignore("skip message")
public void shouldBeSkipped() {
throw new RuntimeException("should not get thrown");
}
}
I've left the remaining lines of test output in the text of the <skipped> node. I'm not sure whether it should just contain all of the output lines (or none). I just did it this way to not duplicate info between the message and node text. I don't expect this case to really come up tbh since logging before skipping a test seems a bit odd.
This PR sets the
<skipped>
node's message attribute to the last line of the output from the skipped test.I've made this change as I came across an issue when trying to integrate this tool with https://github.com/thought-machine/please which only looks at the message attribute of the
<skipped>
node and not the containing text, so was outputtingSkipped
as the reason for each skipped test which isn't very helpful.This seems more the correct behaviour imo since this is how JUnit outputs its XML report:
I've left the remaining lines of test output in the text of the
<skipped>
node. I'm not sure whether it should just contain all of the output lines (or none). I just did it this way to not duplicate info between the message and node text. I don't expect this case to really come up tbh since logging before skipping a test seems a bit odd.