[Pharo-project] testing ui errors in headless mode

Tudor Girba tudor at tudorgirba.com
Tue May 31 22:15:42 CEST 2011


Hi Igor,

Sorry for the late reply.



On 26 May 2011, at 17:48, Igor Stasenko wrote:

> On 26 May 2011 17:03, Tudor Girba <tudor at tudorgirba.com> wrote:
>> Hi,
>> 
>> I tried several ways to get my head around this problem, but I do not know how to proceed. Can anyone help?
>> 
>> Cheers,
>> Doru
>> 
>> 
>> On 25 May 2011, at 21:21, Tudor Girba wrote:
>> 
>>> Hi,
>>> 
>>> We have some smoke tests in Moose that basically spawn a UI and check for Error.
>>> 
>>> This used to work when running headless in Pharo 1.2 but now they fail in Pharo 1.3. I believe this has to do with the new changes in the UI Manager, but I do not know what to do.
>>> 
>>> To reproduce the problem, you can simply call a Pharo-1.3.image in headless mode and file in the attached st file that:
>>> 
>>> - installs a simple test:
>>> HeadlessTest>>testStartup
>>>       self shouldnt:  [1 inspect] raise:  Error
> 
> Tudor, your test is wrong.
> During image startup and in headless mode calling inspector will and
> should raise an error.
> Because inspecting object requires a presence of UI.
> But there's no UI in headless mode and prohibited from use during
> image startup phase, because
> you cannot start asking questions from user before properly
> initializing everything related to startup.
> Startup is called startup on purpose: is should not be interrupted nor
> require user's interaction.
> 
> Assume that you don't have Morphic loaded in your image, then what you
> expect to happen if you do
> 1 inspect
> ?

I understand now that the test is wrong. I just wanted to offer an example of spawning a ui, but I think I found the problem like this :).

Now, the thing is that my test tests that triggering the entries from a menu does not result in an error. And inspect or browse happen to be among the menu entries. Is there a way to still have this test working on the server?

Should I put a guard condition in the method triggering the inspector? That sounds bad. Any other ideas?

Cheers,
Doru




>>> 
>>> - loads HudsonTools
>>> 
>>> - runs the test and outputs the XML file report
>>> 
>>> - although the test should pass, it raises the error:
>>> HeadlessStartupTest(TestCase)>>signalFailure:
>>> HeadlessStartupTest(TestCase)>>assert:
>>> HeadlessStartupTest(TestCase)>>shouldnt:raise:
>>> HeadlessStartupTest>>testStartup
>>> HeadlessStartupTest(TestCase)>>performTest
>>> 
>>> 
>>> Can anyone help?
>>> 
>>> Cheers,
>>> Doru
>>> 
>>> --
>>> www.tudorgirba.com
>>> 
>>> "What is more important: To be happy, or to make happy?"
>>> 
>>> <headlesstest.st>
>> 
>> --
>> www.tudorgirba.com
>> 
>> "It's not what we do that matters most, it's how we do it."
>> 
>> 
>> 
> 
> 
> 
> -- 
> Best regards,
> Igor Stasenko AKA sig.
> 

--
www.tudorgirba.com

"It's not how it is, it is how we see it."




More information about the Pharo-project mailing list