[Pharo-project] about run tests from nautilus
Hi ben I do not know if you saw this behavior but when I press the button on the class of a test methods that are not tests are also executed and reported as failures. For example I got XMLNodeTest>>should: aBlock enumerate: aCollection | enumerated | enumerated := OrderedCollection new. aBlock value: [:each | enumerated add: each]. self assert: enumerated = aCollection asOrderedCollection. executed while it is an helper. With the testrunner I get a class with 100% green tests now. but not with nautilus. Stef
Because some one decided that methods starting with "should" are also tests Ben On Mar 3, 2013, at 10:38 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi ben
I do not know if you saw this behavior but when I press the button on the class of a test methods that are not tests are also executed and reported as failures. For example I got
XMLNodeTest>>should: aBlock enumerate: aCollection | enumerated |
enumerated := OrderedCollection new. aBlock value: [:each | enumerated add: each]. self assert: enumerated = aCollection asOrderedCollection.
executed while it is an helper. With the testrunner I get a class with 100% green tests now. but not with nautilus.
Stef
On 2013-03-03, at 10:55, Benjamin <benjamin.vanryseghem.pharo@gmail.com> wrote:
Because some one decided that methods starting with "should" are also tests
we can be a bit more precise, (selector beginsWith: 'should') and: [ (selector at: 'should' size + 1) isUppercase ]
On Mar 3, 2013, at 10:38 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi ben
I do not know if you saw this behavior but when I press the button on the class of a test methods that are not tests are also executed and reported as failures. For example I got
XMLNodeTest>>should: aBlock enumerate: aCollection | enumerated |
enumerated := OrderedCollection new. aBlock value: [:each | enumerated add: each]. self assert: enumerated = aCollection asOrderedCollection.
executed while it is an helper. With the testrunner I get a class with 100% green tests now. but not with nautilus.
Stef
pfffff can we stop such kind of mess. I frankly do not see the value of self should not be = $a vs self assert: self = $a I looked and most of the tests in Moose do not gain anything to rely on phExample. And now such change break nautilus. Stef
Because some one decided that methods starting with "should" are also tests
we can be a bit more precise,
(selector beginsWith: 'should') and: [ (selector at: 'should' size + 1) isUppercase ]
On Mar 3, 2013, at 10:38 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi ben
I do not know if you saw this behavior but when I press the button on the class of a test methods that are not tests are also executed and reported as failures. For example I got
XMLNodeTest>>should: aBlock enumerate: aCollection | enumerated |
enumerated := OrderedCollection new. aBlock value: [:each | enumerated add: each]. self assert: enumerated = aCollection asOrderedCollection.
executed while it is an helper. With the testrunner I get a class with 100% green tests now. but not with nautilus.
Stef
On 2013-03-03, at 15:38, stephane ducasse <stephane.ducasse@free.fr> wrote:
pfffff can we stop such kind of mess. I frankly do not see the value of
Think about the error messages here.
self should not be = $a
Error message will be something like: Got 'adsfasdfasd' instead of $a
vs self assert: self = $a
and here? Assertion failed AKA 0 contextual information. Now it gets even worse when doing things like #should:raise: and friends. You have to fully restart the test case to even when debugging it just because you don't have decent error messages. Now this is what Phexample brings, 10 clicks less per failed assertion. I want that in 3.0. Besides in most cases a tree rewrite will do the proper transformation, so 0 effort for nice error messages.
I looked and most of the tests in Moose do not gain anything to rely on phExample. And now such change break nautilus.
they don't break nautilus if the test in nautilus were implemented as I said before.
I do not buy this argument you will have to show me. when I see self assert: contents = $A I do not see the difference with contents should be equals: $A except that I do not understand what is be and that every object is extended with should and friends. Then I do not want to chain results of tests. Stef
pfffff can we stop such kind of mess. I frankly do not see the value of
Think about the error messages here.
self should not be = $a
Error message will be something like: Got 'adsfasdfasd' instead of $a
vs self assert: self = $a
and here? Assertion failed
AKA 0 contextual information. Now it gets even worse when doing things like #should:raise: and friends. You have to fully restart the test case to even when debugging it just because you don't have decent error messages.
Now this is what Phexample brings, 10 clicks less per failed assertion. I want that in 3.0. Besides in most cases a tree rewrite will do the proper transformation, so 0 effort for nice error messages.
this is my point I do not see why I get something more complex that what we already have. No need to reply I see that should construct a nice object whatever. Now to me it does not help me. I prefer to get a better Sunit.
I looked and most of the tests in Moose do not gain anything to rely on phExample. And now such change break nautilus.
they don't break nautilus if the test in nautilus were implemented as I said before.
On 2013-03-03, at 21:16, stephane ducasse <stephane.ducasse@free.fr> wrote:
I do not buy this argument you will have to show me.
when I see
self assert: contents = $A
already in this case, looking at the debugger you're stuck with a silly message that doesn't give you the slightest hint of what is wrong. You don't see in the debugger "Got ... instead of $A". You have to write self assert: contents equals: $A to get a "Got ... instead of $A" message. Well now it is matter of style writing contents should = $A Look at all the tests in ReleaseTest, and you will see that we have to manually capture the contents before doing any assertion, otherwise the results on the build server are not of much use. Even if we have a serialized stack with fuel, there is no way I can get the result that was used for the comparison. That is unless I use #assert:equals: everywhere!
I do not see the difference with contents should be equals: $A
no, not #equals, you send #=, which is natural, and get a decent error message for free.
except that I do not understand what is be and that every object is extended with should and friends.
no need to use the #be.
Then I do not want to chain results of tests.
Stef
pfffff can we stop such kind of mess. I frankly do not see the value of
Think about the error messages here.
self should not be = $a
Error message will be something like: Got 'adsfasdfasd' instead of $a
vs self assert: self = $a
and here? Assertion failed
AKA 0 contextual information. Now it gets even worse when doing things like #should:raise: and friends. You have to fully restart the test case to even when debugging it just because you don't have decent error messages.
Now this is what Phexample brings, 10 clicks less per failed assertion. I want that in 3.0. Besides in most cases a tree rewrite will do the proper transformation, so 0 effort for nice error messages.
this is my point I do not see why I get something more complex that what we already have.
No need to reply I see that should construct a nice object whatever. Now to me it does not help me. I prefer to get a better Sunit.
I looked and most of the tests in Moose do not gain anything to rely on phExample. And now such change break nautilus.
they don't break nautilus if the test in nautilus were implemented as I said before.
I see what you mean and you will show that to me. I tend to do not like to have three different testing framework, 5 button classes⦠especially when people building tools have to take care about different conventions. Stef
I do not buy this argument you will have to show me.
when I see
self assert: contents = $A
already in this case, looking at the debugger you're stuck with a silly message that doesn't give you the slightest hint of what is wrong. You don't see in the debugger "Got ... instead of $A".
You have to write
self assert: contents equals: $A
to get a "Got ... instead of $A" message. Well now it is matter of style writing
contents should = $A
Look at all the tests in ReleaseTest, and you will see that we have to manually capture the contents before doing any assertion, otherwise the results on the build server are not of much use. Even if we have a serialized stack with fuel, there is no way I can get the result that was used for the comparison. That is unless I use #assert:equals: everywhere!
I do not see the difference with contents should be equals: $A
no, not #equals, you send #=, which is natural, and get a decent error message for free.
except that I do not understand what is be and that every object is extended with should and friends.
no need to use the #be.
Then I do not want to chain results of tests.
Stef
pfffff can we stop such kind of mess. I frankly do not see the value of
Think about the error messages here.
self should not be = $a
Error message will be something like: Got 'adsfasdfasd' instead of $a
vs self assert: self = $a
and here? Assertion failed
AKA 0 contextual information. Now it gets even worse when doing things like #should:raise: and friends. You have to fully restart the test case to even when debugging it just because you don't have decent error messages.
Now this is what Phexample brings, 10 clicks less per failed assertion. I want that in 3.0. Besides in most cases a tree rewrite will do the proper transformation, so 0 effort for nice error messages.
this is my point I do not see why I get something more complex that what we already have.
No need to reply I see that should construct a nice object whatever. Now to me it does not help me. I prefer to get a better Sunit.
I looked and most of the tests in Moose do not gain anything to rely on phExample. And now such change break nautilus.
they don't break nautilus if the test in nautilus were implemented as I said before.
Camillo Bruni-3 wrote
Now this is what Phexample brings, 10 clicks less per failed assertion. I want that in 3.0
+1 and love good error messages for free ----- Cheers, Sean -- View this message in context: http://forum.world.st/about-run-tests-from-nautilus-tp4673439p4673846.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Hi Benjamin: On 03 Mar 2013, at 10:55, Benjamin wrote:
Because some one decided that methods starting with "should" are also tests
I added that change, because I didn't see an easy and extensible way to do it differently. Please see https://code.google.com/p/pharo/issues/detail?id=7367 If you could provide me with a proper hook in Nautilus, or use the facilities in SUnit to determine whether a method is a test that would be much better and avoid Stephane's problems. Thanks Stefan
Ben
On Mar 3, 2013, at 10:38 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi ben
I do not know if you saw this behavior but when I press the button on the class of a test methods that are not tests are also executed and reported as failures. For example I got
XMLNodeTest>>should: aBlock enumerate: aCollection | enumerated |
enumerated := OrderedCollection new. aBlock value: [:each | enumerated add: each]. self assert: enumerated = aCollection asOrderedCollection.
executed while it is an helper. With the testrunner I get a class with 100% green tests now. but not with nautilus.
Stef
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
If you want locally that your "should'* methods are seen as test by Nautilus, you should create a class inheriting from AbstractMethodIconAction and more or less copy the behaviour of MethodIsTestAction Ben On Mar 3, 2013, at 3:59 PM, Stefan Marr <smalltalk@stefan-marr.de> wrote:
Hi Benjamin:
On 03 Mar 2013, at 10:55, Benjamin wrote:
Because some one decided that methods starting with "should" are also tests
I added that change, because I didn't see an easy and extensible way to do it differently.
Please see https://code.google.com/p/pharo/issues/detail?id=7367
If you could provide me with a proper hook in Nautilus, or use the facilities in SUnit to determine whether a method is a test that would be much better and avoid Stephane's problems.
Thanks Stefan
Ben
On Mar 3, 2013, at 10:38 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi ben
I do not know if you saw this behavior but when I press the button on the class of a test methods that are not tests are also executed and reported as failures. For example I got
XMLNodeTest>>should: aBlock enumerate: aCollection | enumerated |
enumerated := OrderedCollection new. aBlock value: [:each | enumerated add: each]. self assert: enumerated = aCollection asOrderedCollection.
executed while it is an helper. With the testrunner I get a class with 100% green tests now. but not with nautilus.
Stef
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
participants (6)
-
Benjamin -
Camillo Bruni -
Sean P. DeNigris -
Stefan Marr -
stephane ducasse -
Stéphane Ducasse