Bug 340906 - Non UI thread applications no longer have their test harness set
Summary: Non UI thread applications no longer have their test harness set
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 341787 (view as bug list)
Depends on:
Blocks: 340442
  Show dependency tree
 
Reported: 2011-03-24 16:13 EDT by Curtis Windatt CLA
Modified: 2011-04-11 11:20 EDT (History)
5 users (show)

See Also:


Attachments
Patch for pde.junit.runtime (8.72 KB, patch)
2011-04-06 03:54 EDT, Gunnar Wagenknecht CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2011-03-24 16:13:59 EDT
Creating a bug for a regression sent to me by email.

while debugging why our SWTBot based tests don’t run any more (they simply hang after the Eclipse UI starts and the tests won’t get started, see https://hudson.eclipse.org/hudson/job/gmp-graphiti-nightly/560/consoleFull), I stumbled over this Bugzilla (https://bugs.eclipse.org/bugs/show_bug.cgi?id=311979) where you both have done the changes.
We (the Eclipse project Graphiti) use a run configuration of type JUnit Plug-in Test for running our SWTBot –based UI tests on the Eclipse Hudson triggered via Buckminster. Since the Buckminster installation is the “Eclipse IDE” which is used to trigger the test run, we can unfortunately not use an SWTBot Test run configuration. While setting up the build I found a guide that recommended to use a JUnit Plug-in Test configuration instead and set the flag Run in UI Thread to false.
This worked until we switched to the M7 version. Now I debugged quite a while and saw that UITestApplication used to set the testHarness in WorkbenchTestable (until M6) but in M7 doesn’t do this anymore.
Comment 1 Curtis Windatt CLA 2011-03-24 16:21:26 EDT
This looks like a regression.  Gunnar, can you take a look?
Comment 2 Gunnar Wagenknecht CLA 2011-03-24 16:29:06 EDT
Sorry, forgot to forward you the mail. The SWTBot team knows about this limitation and the special requirement. They actually created their own JUnit launch configuration type for this purpose. They actually recommend not using the PDE JUnit launch config type.

http://wiki.eclipse.org/SWTBot/FAQ#Why_do_I_have_to_run_tests_as_SWTBot_tests.2C_instead_of_PDE-JUnit_tests.3F

The issue is now getting this type running in Buckminster. It seems that a simple installation using the p2 director should do the trick.
Comment 3 Michael Wenz CLA 2011-03-25 04:06:51 EDT
(In reply to comment #2)
If I can use a SWTBot run configuration from within the Buckminster installation on the Eclipse Hudson, it would of course solve this for me. But I think that some parts for this are still missing on the SWTBot and/or Buckminster side, or do I miss anything?

Do you have more details on that "simple installation"?

Michael
Comment 4 Curtis Windatt CLA 2011-04-05 15:35:30 EDT
*** Bug 341787 has been marked as a duplicate of this bug. ***
Comment 5 Curtis Windatt CLA 2011-04-05 15:37:31 EDT
There is definitely a regression here, junit tests may not start if the run in UI threads is unchecked.  Increasing severity to critical.

Gunnar can you please take another look.
Comment 6 Gunnar Wagenknecht CLA 2011-04-06 03:54:10 EDT
Created attachment 192617 [details]
Patch for pde.junit.runtime

The attached patch fixed the issue. The Non-UI-Thread test application now checks if Platform UI is available and properly install the test harness in this case.
Comment 7 Gunnar Wagenknecht CLA 2011-04-06 03:56:57 EDT
Note, I also verified that non-ui thread tests will be run *outside* the UI thread as well as that true headless tests continue to run without UI in the target platform.
Comment 8 Curtis Windatt CLA 2011-04-06 10:02:13 EDT
Thanks Gunnar, I will try and look at it today.
Comment 9 Michael Wenz CLA 2011-04-06 11:01:00 EDT
Thanks, Gunnar! I applied that patch locally on my machnine and found that this will solve our issue.

Michael
Comment 10 Curtis Windatt CLA 2011-04-06 11:30:57 EDT
Works for me.  Fixed in HEAD.  On the arch call it was decided to request a rebuild for the fix.
Comment 11 Curtis Windatt CLA 2011-04-11 11:20:56 EDT
Working properly in the rebuild.  Verified.