/srv/irclogs.ubuntu.com/2010/07/07/#launchpad-meeting.txt

abentleyme14:59
bac#startmeeting15:00
MootBotMeeting started at 09:00. The chair is bac.15:00
MootBotCommands Available: [TOPIC], [IDEA], [ACTION], [AGREED], [LINK], [VOTE]15:00
bachi, whose here?15:00
bigjoolsme15:00
sinzuime15:00
gmbme15:00
jtvme15:00
bigjoolswho's here, too :)15:00
bac:)15:00
deryckme15:00
jtvnice cascade we had there15:00
marsme15:00
EdwinGrubbsme15:00
bacbigjools: no, i found a very nice "here" and was wondering who'd claim it15:00
gary_posterme15:01
henningeme15:01
gary_posterI'll take it15:01
noodles775me15:01
gary_posterwell, it's probably not mine15:01
bacwell, let's get started then15:02
adeuringme15:02
bacnot much on the agenda so we should zip right through15:02
bac * Roll call15:02
bac * Agenda15:02
bac * Outstanding actions15:02
bac * New topics15:02
bac   * PQM commit messages: I don't f***ing care what you're currently listening to.  See also https://dev.launchpad.net/PQMCommitMessages [bigjools]15:02
bac * Peanut gallery15:02
bac* jml(?) to set a policy on what can live in lib/lp, lib/services, and lib/coop15:02
bacsince bjornt left us, this item was assigned to jml...but i forgot to tell him about it, so clearly nothing was done.15:03
bacmy bad15:03
flacosteme15:03
bacsinzui: how goes your lint replacement?  good, no?15:03
sinzuilint is queued for landing15:03
bac\o/15:03
sinzuiI will send an email announcing this today15:04
sinzui+ instructions about embedding it in your editor15:04
bacvery nice, thank you.15:04
bacas to new items we only have one15:05
bac[topic] PQM commit messages: I don't f***ing care what you're currently listening to.  See also https://dev.launchpad.net/PQMCommitMessages [bigjools]15:05
MootBotNew Topic:  PQM commit messages: I don't f***ing care what you're currently listening to.  See also https://dev.launchpad.net/PQMCommitMessages [bigjools]15:05
bacbigjools: the floor is yours.15:05
bigjoolswell first, I was in a bad mood when I added that topic title, but I think you get the gist15:05
bigjoolsthe commit messages should follow the style guide15:06
bigjoolsEOT15:06
sinzuiokay15:06
* sinzui stops work to change editor15:06
bacany other thoughts?15:06
henningeIs that spec up to date?15:07
henningee.g. Include bugs fixed in this landing. For each bug, include the bug number and the bug summary next to it. e.g. "Fixes: bug 12345: Mozilla Firefox lacks SVG support; bug 54321: Lack of spacing in new account form."15:07
ubot5Launchpad bug 12345 in isdnutils (Ubuntu) "isdn does not work, fritz avm (pnp?) (affected: 0, heat: 3)" [Medium,Fix released] https://launchpad.net/bugs/1234515:07
ubot5Launchpad bug 54321 in zope-archetypes (Ubuntu) "Please sync zope-archetypes 1.3.9-2 from Debian unstable (affected: 0, heat: 2)" [Undecided,Fix released] https://launchpad.net/bugs/5432115:07
henningeI never do that, I thought that's what [bug=xxx] is for15:08
jtvsame here15:08
bachenninge: you are correct15:08
bacthe guide is out of date15:08
abentleyhenninge, agreed.  ec2 land and lp-land use your syntax.15:08
sinzuibigjools, fixed15:08
baci'll fix it this week15:08
bacthanks sinzui15:09
bigjoolssinzui: sorry, I didn't meant to pick on you specifically.  I've just seen some poor commit messages lately.15:09
bac[action] bac to update https://dev.launchpad.net/PQMCommitMessages15:09
MootBotACTION received:  bac to update https://dev.launchpad.net/PQMCommitMessages15:09
sinzuibigjools, I agree about the poor commit messages...I brought the issue up with Urshina when I was RM. There were 30 bugs un QAed and I could not say what they changed.15:10
gary_posterwe're working on that and will have a report at epic15:10
bigjoolstotally15:11
bigjoolsoh cool15:11
abentleymerge proposals have a slot for the commit message.  Maybe we should encourage people to fill it out as part of the review.15:11
bac[topic] other stuff15:11
MootBotNew Topic:  other stuff15:11
bacabentley: +115:11
bigjools+115:11
bacanything else to discuss today15:11
bac?15:11
gary_posterbenji is a new launchpadder15:12
gary_posterhe's doing new launchpaddy things now15:12
gary_posterbut he will be asking for reviews15:12
bacgreat gary_poster15:12
gary_posterand will eventually want to go through the mentat process15:12
henningeI had a few issues come up in a recent review, let me pick one.15:12
baceveryone should make an effort to say hi to benji this week15:12
gary_poster+1, was hoping I could get him at this meeting15:13
henningeAnybody ever heard a guideline "one assert per test" in functional test cases?15:13
baci have not15:14
abentleyhenninge, no.15:14
henningeThe problem with multiple asserts is that the test will abort and the remaing asserts will not be executed.15:14
=== Ursinha is now known as Ursinha-brb
abentleyhenninge, the problem with one assert per test is that set-up time increases.15:14
abentleyhenninge, not to mention much more finger-typing.15:14
henningeabentley: it's either that or smarter asserts.15:15
bacand probably a less readable test15:15
gmbhenninge, I'm not clear on how the abort is really a problem. For a start, it means you get to fix one test failure at a time rather than having to dig through many.15:15
abentleyhenninge, what's the disadvantage of having the test abort and not executing the remaining asserts?15:15
henningehang on15:16
henningeCode like this:15:16
henninge> +        self.assertEquals(1, len(result_set))15:16
henninge> >>> +        self.assertEquals(self.ppa, result_set[0].archive)15:16
henninge> >>> +        self.assertEquals(self.cell_proc, result_set[0].processorfamily)15:16
henninge>>15:16
henningeYou can test all three conditions at the same time. You can see how many rows15:17
henningewere returned instead and what their values are. Much more useful.15:17
henningeThe problem with multiple assert statements in one test method is that not all15:17
henningewill be executed if one fails and you are missing valuable information that15:17
henningeyou can only gain by changing the test code and running the test again.15:17
henningeFor example, if result_set contained 2 instead of the expected 1 elements,15:17
abentleyAnd how often would the test have failed anyway, because the remaining asserts assume the first assert passed?15:17
henningeyou'd want to know what the two contain but this test would not even tell you15:17
henningewhat the first contains because the asserts don't get called.15:17
bigjoolsabentley: point15:17
abentleyhenninge, so in your example, what if len==0?15:18
henningeabentley: sure, we should just make sure that is really the case. The dependency i mean.15:18
henningeThe example is missing my proposed solution which would be comparing lists.15:18
abentleyhenninge, and since you're getting results you're not expecting, how do you know that result_set[0] is testing the right thing?15:18
henningeif len == 0, the list would be empty.15:18
adeuringyou can have a test for "method X changes A into B". The test may need something like "assert(A); do_something(); assert(B)".  "assert(A)" may not be strictly needed, but it can help to ensure that you have a proper test setup.15:19
abentleyhenninge, right, and the rest of the asserts will raise IndexError.  Which seems like meaningless exceptions to me.15:19
henningeMy suggestion:15:20
henningeresult = [(row.archive, row.processorfamily) for row in result_set]15:20
henningeself.assertEqual([(self.ppa, self.cell_proc)], result)15:20
henningeFrom the review^15:20
henningeabentley: there are no other asserts to fail.15:20
abentleyI thought self.assertEquals(self.ppa, result_set[0].archive) is an assert that would fail15:21
henningeabentley: with len== 0? yes15:22
bachenninge: i like your suggestion in this instance.  i don't think we'd want to generalize to a restriction of one assert per test case as other situations may not lend themselves so nicely.15:22
abentleyhenninge, If we followed a "one assert per test" rule, we might have the same test three times, with the different asserts.15:22
henningeI was not proposing a rule15:22
bacok, i see you said 'guideline'.15:23
henningejust to have people think about smart asserts.15:23
abentleyhenninge, sorry, *guideline*15:23
abentleyhenninge, I like your solution.15:23
abentleyhenninge, but if you hadn't thought of it, I don't think applying the guideline would make sense.15:23
sinzuiI recall the reason for "one assert per test" was not 10 asserts in a test, but that the test was actually several tests.15:23
abentleyhenninge, because it would multiply the number of tests and failures in ways that are not useful.15:24
henningejust make sure that functional tests suffer not from similar dependency problems like doctest might do.15:24
sinzuiWhen an object is transitioned to a new state, it may be legitimate to very 3 aspects of the state, but not to then do another state change15:24
sinzuiWe had several tests that did that a few years ago15:24
henningesinzui: jtv and I just looked at one this morning ... ;)15:25
henningeanyway, I have made my point.15:25
jtvhenninge: I think that one did go through multiple state changes15:25
jtv...with separate assertions15:25
abentleysinzui, I'm very much in favour of "test only one thing" as a guideline.15:25
sinzuiabentley, I have read your tests, and I know you are15:26
henningeI had it mentioned to me in a review when I first started and just wanted to check if that is the general opinion.15:26
bigjoolsthe exception to that is where the setup is very expensive15:26
henningejtv: right.15:26
abentleybigjools, though often those are integration tests, so what you're testing is the integration, not the units.15:27
bigjoolspossibly15:28
abentleybigjools, YMMV15:28
bachenninge: thanks for bringing this up.  i think reducing the asserts, as you did in your example, is a good idea where practical.15:28
jtvAnother form of testing-too-many-things is where the test sets up a large set of data, and then either performs the operation once and checks all the outputs; or several times with separate checks but without a clear reason why the output should be as expected.15:28
bigjoolsabentley: especially in Soyuz :)15:28
bacany other topics?15:29
bac315:29
bac215:29
bac115:29
bacthanks everyone15:29
bigjoolsthanks15:29
bac#endmeeting15:29
MootBotMeeting finished at 09:29.15:29
bacgo read http://elliotmurphy.com/2010/07/06/teambuilding-and-culture-in-a-distributed-workplace/ for a canonical warm-n-fuzzy15:30
bigjoolsbac: that blog post is awesome, I read it yesterday and had a huge smile on my face15:47
=== leonardr is now known as leonardr-afk
=== salgado is now known as salgado-lunch
=== gary_poster is now known as gary-lunch
=== salgado-lunch is now known as salgado
=== Ursinha-brb is now known as Ursinha
=== gary-lunch is now known as gary_poster
=== EdwinGrubbs is now known as Edwin-lunch
=== Edwin-lunch is now known as EdwinGrubbs
bacthumper, rockstar: reviewer meeting?22:33
thumperbac: rockstar just went for a walk22:34
bacthumper: ok.  we didn't get up to much in the earlier meeting.22:34
bacthumper: main item was bigjools requesting that we follow the PQM submit message guidelines22:34
bacthumper: by that he meant cut out extraneous stuff like what music is playing, etc.22:35
baceveryone agreed22:35
bachenninge brought up the topic of a single assert per test case in functional tests which led to a pretty long discussion22:35
bache was concerned that after the first assertion fails the test stops and you don't see the results of the later assertions22:36
thumperhmm22:36
bacwe agreed that in the cases where you can do something clever to avoid multiple assertions then that was ok but we didn't want to codify such a thing22:36
thumperpersonally I don't care about the commit message thing22:36
thumperI'm happy to go either way22:37
bachenning agreed it should be a guildeline22:37
bacme too22:37
thumperI don't like the single assert in a test thing22:37
thumperif you want to see the others, I think there is a flag22:37
bacreally?22:37
* thumper thinks22:38
thumpermaybe?22:38
bacdunno22:38
thumperlifeless would probably know22:38
thumperif there isn't one, we could add one22:38
thumperit isn't rocket science22:38
baci'll look into it22:38
thumperta22:38
thumperWRT unit tests22:39
bacoften if an earlier assert dies then those following don't have much chance22:39
bigjoolsthe commit message thing was more about writing something that actually explained the fix properly22:39
thumperI would say that the test should be short22:39
thumperand primarily test one thing22:39
thumperbut that one thing may well need multiple asserts22:39
bacthumper: yes, you're channeling the gist of our discussion22:40
thumperok22:40
thumperwe're on the the same page then22:40
bacyeppers22:40
=== salgado is now known as salgado-afk
bacthat was it.22:41
bacthumper: you have anything to pass on?22:41
thumperok, I guess we are done then22:41
bacright.  have a good day.22:41
thumpernot, not really22:41
thumpersee you next week22:41

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!