This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | surefire 2.19.1 show no test results windows | ||
---|---|---|---|
Product: | projects | Reporter: | skygo <skygo> |
Component: | Maven | Assignee: | markiewb |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | karileh, markiewb, radzikowski, Saljack, Yaytay |
Priority: | P2 | Keywords: | NETFIX, PATCH_AVAILABLE |
Version: | 8.2 | ||
Hardware: | PC | ||
OS: | Windows 10 x64 | ||
See Also: |
https://issues.apache.org/jira/browse/SUREFIRE-1158 https://issues.apache.org/jira/browse/SUREFIRE-1216 |
||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Snapshot of POM file
Sample project with surefire 2.19.2-SN Patch to support surefire >=2.19 |
Description
skygo
2016-01-14 13:45:58 UTC
Same here, NetBeans 8.1 with latest updates, Oracle JDK 8, Linux 32-bit. Have to stick to maven-surefire-plugin 2.18. Probably screenscraping plugin output is a bad idea, can it be done in some other way? Just spent 30 minutes hunting down this bug while setting up a new project. I think this needs to be raised in priority, just because getting the 'green bar' in the test results window is such a key part of the workflow, you get a vague sense of panic when it does not appear. There is nothing in the GUI to help you debug this, either--no error message or anything. Same on my machine. NB 8.1 surefire 2.18.1 work and surefire 2.19 doesn't. Found one difference in the surefire output. In 2.19 output there is the namespace defined in the testsuite tag. <testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name=... In 2.18.1 not <testsuite name=... Maybe it will help . > I think this needs to be raised in priority
Agreed, without the test result it's really annoying.
*** Bug 259108 has been marked as a duplicate of this bug. *** This is almost a blocker for me. I can't even see the stacktraces when tests are in error. I am the only one on my team using Netbeans, do you think the others, the Eclipse and IDEA users, are willing to downgrade surefire just because my Netbeans don't cut it? (In reply to nedenom from comment #6) > This is almost a blocker for me. I can't even see the stacktraces when tests > are in error. > > I am the only one on my team using Netbeans, do you think the others, the > Eclipse and IDEA users, are willing to downgrade surefire just because my > Netbeans don't cut it? Just downgrade to 2.18.1. Looks to be a bug on surefire. (In reply to javydreamercsw from comment #7) > (In reply to nedenom from comment #6) > > This is almost a blocker for me. I can't even see the stacktraces when tests > > are in error. > > > > I am the only one on my team using Netbeans, do you think the others, the > > Eclipse and IDEA users, are willing to downgrade surefire just because my > > Netbeans don't cut it? > > Just downgrade to 2.18.1. Looks to be a bug on surefire. Did you look at helmut's hint: In 2.19.1 <testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name=... In 2.18.1 not <testsuite name=... If it is that the reason, then I would'nt say it is Surefire bug. (In reply to nedenom from comment #6) > This is almost a blocker for me. I can't even see the stacktraces when tests > are in error. > > I am the only one on my team using Netbeans, do you think the others, the > Eclipse and IDEA users, are willing to downgrade surefire just because my > Netbeans don't cut it? Same here... I am the only one using Netbeans and working on a code base together with some 25 other developers. This bug should effect every user that uses maven projects and should be addressed. Created attachment 161643 [details]
Snapshot of POM file
The bug is still there. Instead of setting <skipTests> to false just comment out the thing, build with dependencies, and then your ready to go. Does it help to downgrade SureFIre plugin if running NB 8.1? It is a known surefire 2.19.1 bug. https://issues.apache.org/jira/browse/SUREFIRE-1216 Wait for 2.19.2! OK interesting. So finally it is Surefire bug. Can't wait for 2.19.2. Thank you Benno for investigating. Hi, I tried the 2.19.2-SNAPSHOT, Test Results window show again but in case of failure the stack trace is not present, it only shows the last error. Not sure but it may need adaptation on NetBeans side maybe. Created attachment 161931 [details]
Sample project with surefire 2.19.2-SN
(In reply to skygo from comment #14) > Hi, > I tried the 2.19.2-SNAPSHOT, Test Results window show again but in case of > failure the stack trace is not present, it only shows the last error. > > Not sure but it may need adaptation on NetBeans side maybe. Yes, it broken because surefire changed their output format. No even the testoutput window is opened. Try out the maven project attached at https://netbeans.org/bugzilla/attachment.cgi?id=161931 Here are the outputs ====%<=============================================================================== --- maven-surefire-plugin:2.18:test (default-test) @ mavenproject1 --- Surefire report directory: C:\Users\markiewb\AppData\Local\Temp\mavenproject1\target\surefire-reports file.encoding cannot be set as system property, use <argLine>-Dfile.encoding=...<argLine> instead ------------------------------------------------------- T E S T S ------------------------------------------------------- Running test.mavenproject1.NewClassTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in test.mavenproject1.NewClassTest Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 --- maven-surefire-plugin:2.19.2-SNAPSHOT:test (default-test) @ mavenproject1 --- file.encoding cannot be set as system property, use <argLine>-Dfile.encoding=...</argLine> instead ------------------------------------------------------- T E S T S ------------------------------------------------------- Running test.mavenproject1.NewClassTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.063 s - in test.mavenproject1.NewClassTest Results: Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 ====%<=============================================================================== Since in 2.19.x the line Surefire report directory: C:\Users\markiewb\AppData\Local\Temp\mavenproject1\target\surefire-reports is missing. But this line is required to get the current project in org.netbeans.modules.maven.junit.JUnitOutputListenerProvider.createSession(File) outDirPattern = Pattern.compile ("(?:\\[INFO\\] )?Surefire report directory\\: (?<" + GROUP_FILE_NAME + ">.*)", Pattern.DOTALL); //NOI18N outDirPattern2 = Pattern.compile("(?:\\[INFO\\] )?Setting reports dir\\: (?<" + GROUP_FILE_NAME + ">.*)", Pattern.DOTALL); //NOI18N It has been removed by https://issues.apache.org/jira/browse/SUREFIRE-1158 https://github.com/apache/maven-surefire/pull/95/commits/67e6606d51e24ecfd4bfe75e4f4dd906f9e88435 by decreasing the log level. Created attachment 161934 [details]
Patch to support surefire >=2.19
Here is a patch, which reads the output directory from the pom configuration instead from the console.
@NB-Dev: Please review! It works with surefire 2.19, 2.19.1, 2.19.2-SN and 2.20-SN
Works well and also backward compatible with 2.18 :p Only stacktrace is different in case of error if you alter NewClass.method to make it public and have the following body throw new UnsupportedOperationException("ISSUE."); if you alter NewClassTest.testMain to have the following body NewClass newClass = new NewClass(); newClass.method(); With surefire 2.18 java.lang.UnsupportedOperationException: ISSUE. at test.mavenproject1.NewClass.method(NewClass.java:22) at test.mavenproject1.NewClassTest.testMain(NewClassTest.java:23) With surefire 2.19.2 java.lang.UnsupportedOperationException: ISSUE. at test.mavenproject1.NewClassTest.testMain(NewClassTest.java:23) I cannot figure out what change in surefire for this issue, but this is annoying because it's prevent better usage we can do with NetBeans to track the root cause of the exception to correct class if test seems ok. With 13 votes this issue needs to be P2 according to our Bug Priority Guidelines [1]. Updating accordingly. [1] http://wiki.netbeans.org/BugPriorityGuidelines (In reply to skygo from comment #18) > Works well and also backward compatible with 2.18 :p > > Only stacktrace is different in case of error > > if you alter NewClass.method to make it public and have the following body > throw new UnsupportedOperationException("ISSUE."); > > if you alter NewClassTest.testMain to have the following body > NewClass newClass = new NewClass(); > newClass.method(); > > With surefire 2.18 > java.lang.UnsupportedOperationException: ISSUE. > at test.mavenproject1.NewClass.method(NewClass.java:22) > at test.mavenproject1.NewClassTest.testMain(NewClassTest.java:23) > > With surefire 2.19.2 > java.lang.UnsupportedOperationException: ISSUE. > at test.mavenproject1.NewClassTest.testMain(NewClassTest.java:23) > > I cannot figure out what change in surefire for this issue, but this is > annoying because it's prevent better usage we can do with NetBeans to track > the root cause of the exception to correct class if test seems ok. -> Please file a new issue for that. At NB bugzilla and at the Surefire-Plugin-JIRA, because trimming the stacktrace by surefire 2.19 removes relevant information. I guess it is caused by https://issues.apache.org/jira/browse/SUREFIRE-1067 / https://issues.apache.org/jira/browse/SUREFIRE-1050 As a workaround use -DtrimStackTrace=false > Created attachment 161934 [details]
> Patch to support surefire >=2.19
> Here is a patch, which reads the output directory from the pom configuration instead from the console.
looks ok, feel free to integrate
thanks
fixed in jet-main #8376384b90a3 integrated into releases82 #ff862e19c5a7 Integrated into 'main-silver', will be available in build *201609090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/8376384b90a3 User: Tomas Stupka <tstupka@netbeans.org> Log: Issue #257563 - surefire 2.19.1 show no test results windows Eric, can you please verify this bug? Thanks! Tests Windows is now working with 2.19.1. To get the full stack as it was before you need to set the parameter trimStackTrace to false (not a workaround but the legit way :p) https://issues.apache.org/jira/browse/SUREFIRE-1277 Thanks for the fix ! Was this released on 8.2? I still see this issue. It is marked as 8.2 milestone and has been fixed for almost 6 months already. |