Le 21/4/15 17:32, Otto Behrens a écrit :
Thanks. I do <alt>jc on a method sometimes when I have changed a
method. So sometimes I so <alt>jm and then immediately <alt>jc to
check all the tests in the class.
Indeed, Nautilus logic to run test differs a bit from the TestRunner logic.
Does it really have to be?
For example, if your test fails, it is run a second time to open a debugger but
it could do side effects.
This has been a problem for me for a long time. I would *love* it if
Nautilus runs a single test in debug mode (and not a second time).
Me too :)
It
is especially painful when running selenium tests in our environment,
because firefox is launched on every test suite run, which makes
running a single test relatively expensive. I suppose solving the
problem of tests running a long time is first prize.
Why don't you just run your tests from the test runner or using MyTestClass
run: #testSelector ?
Because I normally run the tests that I work on while I'm in the
Nautilus browser (using shortcut keys). Why would I want to launch a
different browser, search for the class I'm working on and run the
tests there?
I could be missing it totally here. I'm quite interested to know how
other people work. A sort of work flow, to the point of running tests.
To run all my tests take a long time. There are quite a few.
We will need to clean this kind of logic that should not be part of Nautilus.
Could you open a bug entry for that?
https://pharo.fogbugz.com/f/cases/15374/exception-handling-when-running-tests-in-Nautilus
Is this the right place?
Regards,
Christophe.
Le 21 avr. 2015 à 15:34, Otto Behrens a écrit :
I realised I may have posted this on the wrong list. Is there anyone
that can help with this one please?
---------- Forwarded message ----------
From: Otto Behrens <o...@finworks.biz>
Date: Sun, Apr 19, 2015 at 10:08 AM
Subject: exception handling problem when running tests in Nautilus
To: pharo-us...@lists.pharo.org
Hi,
Thanks everyone for the new Pharo and all the work done. I like Spotter!
I gave Pharo 4 a try today and ran into a problem with running tests
in a TestCase (test class -> run tests). I just get the debugger
popping up with WARequestContextNotFound.
In the setUp of our test case, we call WACurrentRequestContext value,
but handle the error when we do not have a context, for example:
[ WACurrentRequestContext value. true ]
on: WARequestContextNotFound
do: [ :e | false ]
This handler: "[ :e | false ]" is never called. What influences this
is the exception handling in:
AbstractNautilusUI >> #runTestsOfClass:notifying:
Firstly, I think that it may be slighly better to call "e pass" or "e
outer" in stead of "e defaultAction", as this would give another outer
handler a chance to do something. The defaultAction is called when
there are no more outer handlers anyway.
After trying this, it did not help my cause. And I think that this is
because the WACurrentRequestContext is a Notification and not an
Error.
I then replaced Exception with Error in the handler in
AbstractNautilusUI. This seem to work. What also works is to
completely remove the exception handling in AbstractNautilusUI >>
#runTestsOfClass:notifying:
What is a bit strange is the inconsistency in this exception handling
when running a suite or an individual test. Perhaps this kind of code
could be better on the TestSuite and not in the Nautilus UI?
Can anyone please help? Should I be doing something else?
Cheers
Otto