Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 434648 - "All tests passed" when exception is thrown in surefire booter
Summary: "All tests passed" when exception is thrown in surefire booter
Status: VERIFIED DUPLICATE of bug 436073
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 424255 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-12 09:28 EDT by Tobias Oberlies CLA
Modified: 2021-04-28 16:52 EDT (History)
2 users (show)

See Also:


Attachments
Tentative IT test (7.47 KB, patch)
2014-05-12 11:43 EDT, Mickael Istria CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Oberlies CLA 2014-05-12 09:28:03 EDT
When the test runtime doesn't start up normally, e.g. when an exception is thrown in OsgiSurefireBooter.getBundleClassLoader(String) the message "All tests passed!" is printed an the build succeeds. The build should fail.

There are different ways to reproduce this:
* Throw a RuntimeException in the start method of the BundleActivator of the test bundle
* Add a platform filter which doesn't match your OS to the test bundle manifest, e.g. Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86))
Comment 1 Jan Sievers CLA 2014-05-12 09:36:08 EDT
may be the same issue as bug 410685 and/or bug 424255
Comment 2 Mickael Istria CLA 2014-05-12 09:45:47 EDT
I agree with Jan, bugs 410685 and 424255 seems to some instances of this bug.
The issue is probably that AbstractUITestApplication.runTests methods only does a printStackTrace when catching an exception from the OSGiSurefireBooter.
http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/AbstractUITestApplication.java#n36

Instead, the failure should be stored and checked in order to compute the application return code (that shouldn't be 0 when an exception was caught).
Comment 3 Tobias Oberlies CLA 2014-05-12 09:57:03 EDT
*** Bug 424255 has been marked as a duplicate of this bug. ***
Comment 4 Mickael Istria CLA 2014-05-12 11:43:19 EDT
Created attachment 242977 [details]
Tentative IT test

(In reply to Tobias Oberlies from comment #0)
> There are different ways to reproduce this:
> * Throw a RuntimeException in the start method of the BundleActivator of the
> test bundle

I just tried to write an integration-test that does what's described here, but the behaviour seems correct with 0.21.0-SNAPSHOT: surefire fails and report error 13 while Eclipse log contains the root cause.
Comment 5 Jan Sievers CLA 2014-07-04 07:36:40 EDT
> There are different ways to reproduce this:
> * Throw a RuntimeException in the start method of the BundleActivator of the
> test bundle
> * Add a platform filter which doesn't match your OS to the test bundle
> manifest, e.g. Eclipse-PlatformFilter: (& (osgi.ws=win32) (osgi.os=win32)
> (osgi.arch=x86))

Using the attached sample, both of these fail the build as expected.
I also tried throwing a hardcoded a RuntimeException in OsgiSurefireBooter.getBundleClassLoader(String) and the build fails as expected.

Behaviour is consistent and works as expected with tycho 0.19.0, 0.20.0 and 0.21.0-SNAPSHOT.

This bug needs a project to reproduce. If you re-open, make sure to attach a sample project demonstrating the issue.
Comment 6 Tobias Oberlies CLA 2014-07-14 09:06:26 EDT
Sorry, I forgot to mention in my description that I was using a Luna M6 target platform.

So the observed problem was in fact Equinox bug 436073.

*** This bug has been marked as a duplicate of bug 436073 ***