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.

Bug 177863 - Support for JUnit Attachments Plugin
Summary: Support for JUnit Attachments Plugin
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: NB JUnit (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL: http://wiki.hudson-ci.org/display/HUD...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-30 09:15 UTC by Jesse Glick
Modified: 2014-11-14 15:35 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-11-30 09:15:07 UTC
NbTestCase.noteWorkDir saves a copy of the workdir for a failed test. Similarly, JellyTestCase.captureScreen saves a screenshot of the application when the test failed. There are provisions to print a hyperlink to the log in case you are running inside Hudson and the test's work dir is inside the build's workspace.

These are useful, but much better would be to actually display these artifacts in the Hudson report. A new plugin promises to do just this.

The NbTC and JTC features should be rewritten to place files in the location this plugin expects. There is no need for an explicit dependency on Hudson information; rather, we need to somehow know

1. What the name of the top-level test being run is. Often getClass().getName() but may differ if a suite was initially run which loads some test cases in sequence, e.g. class.name = IDEValidation but we need to know IDECommitValidation. Not yet obvious how to determine this from the test JVM. Cannot be passed to <junit> because that is running many tests according to a patternset.

2. The location of the test's XML results, as opposed to the nbjunit work dir. Probably this would just need to be passed to the test JVM as a system property by common.xml.

Given these things, should be able to save a copy of workdir to ${test.whatever.results.dir}/${test.class.name} and it should be archived automatically if the right plugin is installed. Can then delete JTC.noteCaptureFile (just prints messages to log), and change NbTC.noteWorkDir to only call copytree.

Also need to double-check that existing jobs are configured to look for JUnit results as e.g. **/TEST-*.xml, rather than **/*.xml which could match unrelated XML files in the attachments.

Would be great if the plugin could be modified to set a flag, probably as an environment variable, in all builds when it was active. That way the copying in NbTC could take place iff it were running from a Hudson installation in which the plugin was active. As a first approximation, could disable the behavior if $HUDSON_HOME is unset.
Comment 1 Jaroslav Tulach 2012-11-27 14:29:29 UTC
Any update on current state of the Hudson plugin?
Comment 2 Jesse Glick 2012-12-03 18:42:08 UTC
The Jenkins plugin [1] appears active. No idea if it would still work on Hudson. The current version will recognize a message printed in a special form giving the location of an attachment, so there is no need to copy files.

[1] https://wiki.jenkins-ci.org/display/JENKINS/JUnit+Attachments+Plugin
Comment 3 Jaroslav Tulach 2014-11-14 15:35:39 UTC
No plans to work on this. I think we are OK with current NbTestCase behavior.