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 142028 - Modules without test/unit/data do not use harness during test-single task
Summary: Modules without test/unit/data do not use harness during test-single task
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2008-07-29 11:32 UTC by Martin Krauskopf
Modified: 2008-08-03 03:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Krauskopf 2008-07-29 11:32:42 UTC
Is is regression caused by Honza's commit:

  http://hg.netbeans.org/main?cmd=changeset;node=ed7376ef0dcc

If you have $NB_HG_MAIN/some.module which does not have 'test/unit/data' subfolder, running single test from IDE might
be broken, since harness is bypassed. Thus it might fail, e.g. in cases your tests using
some.module/nbproject/project.properties#test-unit-sys-prop* properties.

Not easy to find (found by debugging) -> P2.

Workaround is simple 'mkdir -p some.module/test/unit/data', once one knows.
Comment 1 Martin Krauskopf 2008-07-29 11:33:51 UTC
Forgot to CC Honza. Honzo see original comment.
Comment 2 rmichalsky 2008-07-29 13:54:16 UTC
A duplicity, but thanks a lot for pointer and workaround :).

*** This issue has been marked as a duplicate of 141246 ***
Comment 3 Lukas Hasik 2008-07-29 14:01:04 UTC
61m2 ???
Comment 4 Jesse Glick 2008-07-29 23:26:27 UTC
I don't think this is a duplicate. Martin's problem is that test-unit-sys-prop.* fail to be defined in the test JVM. The
problem in issue #141246 is that the classpath is wrong.

This is not really a regression from #ed7376ef0dcc, which just corrected some bogus logic. The problem is that jlahoda's
original implementation of NBM test-single using ProjectRunner is just not right - it fails to pass any system
properties whatsoever, when a number of properties are passed by the harness.
Comment 5 Martin Krauskopf 2008-07-30 07:21:18 UTC
> Martin's problem is that test-unit-sys-prop.*

That was just example of my problem. More things are wrong, so might be the same issue. The problem is that when the
folder does not exist, running single test from the IDE (S-F6 on test) ends up in calling
ModuleActions#bypassAntBuildScript and thus target:

  $userdir/var/cache/executor-snippets/junit.xml#test
    Build sequence for target(s) `test' is [test]
    Complete build sequence is [test, ]
    ....

But after creating a folder (or reverting Honza's patch), ModuleActions#setupTestSingle is used to prepare target (which
is right thing):

  $hg_main/nbbuild/templates/common.xml#test-single
    Build sequence for target(s) `test-single' is [init-tasks, default.init, .... <long_list_of_targets>]


So much more things then just test-unit-sys-prop.* are 'skipped'.

Up to Richard whether really dupe or not, I don't know.
Comment 6 Jan Lahoda 2008-07-30 08:22:41 UTC
Lack of correct propagation of system properties is a bug I plan to fix soon. The fact that the "full" build scripts are
ignored is not a bug - it is intentional (to take advantage of the compile-on-save feature). The intent is to bypass the
ant scripts in usual cases, and resort to traditional build scripts is necessary. If you need "full"/traditional build
scripts, simply place:
quick.test.single=false
into your project.properties. However, if you do this, we would like to hear the reasons why you cannot use the quick
run, in order to decide whether such use case should (or could) be supported by the quick run.
Comment 7 Martin Krauskopf 2008-07-30 08:41:01 UTC
> However, if you do this, we would like to hear the reasons why you cannot use the quick
> run, in order to decide whether such use case should (or could) be supported by the quick run.

So far, I personally only have problem with non-propagation of test system properties.
Comment 8 Jesse Glick 2008-07-30 15:05:16 UTC
I have not encountered the problem with test-unit-sys-prop.* yet (that I know of); my main problem is with the CP, which
as described in issue #141246 is quite different from that used by the full build script.

Good to know about quick.test.single=false, I will use that as a workaround for now (best to leave it in
private.properties only I guess).
Comment 9 Jan Lahoda 2008-08-02 13:39:53 UTC
Support fox system properties (also for J2SE Projects):
http://hg.netbeans.org/main/rev/171cfde69ddb
Comment 10 Quality Engineering 2008-08-03 03:41:50 UTC
Integrated into 'main-golden', available in build *200808030201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/171cfde69ddb
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #142028: support for system properties in quick run/test.