File size: 6,430 Bytes
4aa5fce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
=== wgrant_ is now known as wgrant
[02:54] <nigelb> lifeless / wgrant: around longer?
[04:40] <wgrant> nigelb: Hi.
[04:52] <nigelb> wgrant: just need a quick help with a test
[04:52] <wgrant> nigelb: Sure.
[04:53] <nigelb> I add some code to the linkchecker
[04:53] <nigelb> and I'm writing tests for private bugs
[04:53] <nigelb> Is thre a place I can see an example of a private bug creation?
[04:54] <wgrant> Something like factory.makeBug(private=True) doesn't do what you want?
[04:58] <nigelb> sure, but I also want a use who can see that :)
[04:58] <wgrant> makePerson()
[04:58] <nigelb> I also want a user who can see the bug :)
[04:58] <wgrant> bug.subscribe(person, person)
[04:58] <nigelb> ahh~
[04:59] <nigelb> also, the '/bug/1234', I'll need to just build that myself right?
[04:59] <wgrant> But the anonymous user won't be able to call bug.subscribe(); you might need to use 'with celebrity_logged_in("admin")' or so.
[04:59] <wgrant> canonical_url(bug) will give you the URL.
[05:00] <nigelb> trying now
[05:01] <nigelb> Also, urgh @ YUI tests.
[05:56] <nigelb> wgrant: er, lol. what's the guranteed way to come up with an invalid bug number?
[06:00] <wgrant> nigelb: Well, depending on the test, you could find the max bug number and add 1. Or deliberately make a hole in the postgres sequence. Or use sys.maxint. Or something.
[06:00] <nigelb> ah, there'sa wway to find max bug number.
[06:07] <lifeless> nigelb: why do you want an invalid bug number ?
[06:07] <nigelb> lifeless: the link checker returns valudes when the bug number is invalid.
[06:07] <nigelb> (or private)
[06:07] <nigelb> I want to catch both cases.
[06:07] <lifeless> 'valudes' ?
[06:08] <nigelb> *values
[06:08] <lifeless> it is doing that? or you think its doing that ?
[06:09] <nigelb> It is doing that. I wrote the code ^-^
[06:09] <lifeless> If you used the approach I suggested, you don't need to discriminate between private (won't be found in a search), nonexisting (won't be found in a search)
[06:09] <nigelb> Ah
[06:09] <nigelb> So, just give it a private bug and then assume the same for invalid?
[06:10] <lifeless> unless your code actually discriminates between private and invalid, any change in behaviour is out of the scope of your code and you shouldn't test it there
[06:10] <lifeless> does your code discriminate ?
[06:10] <nigelb> nope
[06:10] <lifeless> then you should rely on the interface you're using (bug search) and its tests ;)
[06:10] <nigelb> oh.
[06:11] <nigelb> but I still should be testing my code for valid vs invalid bugs right?
[06:11] <nigelb> where invalid maybe be private or nonexistant.
[06:12] <nigelb> But you're saying that I should not test for private and nonexistant since my code doesn't differentiate between them
[06:12]  * nigelb is unwell and not completely awake.
[06:44] <nigelb> Ugh, I feel like stabbing YUI.
[06:48] <lifeless> nigelb: thats what I'm saying, yes.
[06:48] <lifeless> a unit test should only test the behaviour of the unit under test
[06:48] <lifeless> *integration* tests may test multiple layers, but they should be few and far between.
[06:49] <nigelb> lifeless: I did what you suggested :)
[06:50] <nigelb> Now, onto testing the javascript code
[06:50] <nigelb> aka stabing YUI.
[07:21] <nigelb> hm, can't it working. Maybe I should ask someone on Monday.
=== Peng__ is now known as Peng
[12:59]  * jelmer waves
[13:00] <StevenK> jelmer: O hai -- could you look at the db-devel failure and see if the conflict I fixed had anything to do with it?
[13:03] <jelmer> StevenK: Sure, let me have a quick look
[13:53] <jelmer> StevenK: looks like they have somewhat to do with your branch - db-devel has bzr 2.4, which has slightly different locking semantics
[13:54] <jelmer> argh, I wish testr integrated better with the launchpad testsuite :-/
[14:03] <jelmer> that said, I can't reproduce the errors here, they look spurious
[14:05] <StevenK> jelmer: Feel free to force a build, then
[14:06] <jelmer> StevenK: it haz been done
[14:14] <nigelb> 54
[14:14] <nigelb> gah
[20:04] <lifeless> *yawn* morning
[20:04] <lifeless> jelmer: please file bugs about things that make the integration poor
[20:09] <jelmer> lifeless: will do
[20:10] <lifeless> wgrant and I are using it for lxc based parallel test dispatch
[20:11] <jelmer> ah, neat
[20:52] <lifeless> and its new project time again
[20:52] <lifeless> \o/
[20:53] <jelmer> lifeless: what are you starting now?
[20:54] <lifeless> jelmer: gpgfixtures
[20:55] <lifeless> jelmer: test support for gpg - extracting the stub keyserver etc from lp
[20:55] <lifeless> so that I can test the gpg verification web service sensibly without code duplication or importing LP
[20:56] <lifeless> jelmer: I made 3 new LP projects last week :P
[20:56] <jelmer> lifeless:
[20:56] <jelmer> whoa
[20:57] <lifeless> lp:python-oops, lp:python-oops-wsgi and lp:python-oops-datedir-repo
[20:58] <lifeless> jelmer: https://dev.launchpad.net/CreatingNewProjects has probably been polished since you last read it
[20:59] <jelmer> lifeless: None < any(last_modified_time) :P
[20:59] <jelmer> lifeless: does that mean things that are split off no longer have to be "lazr" projects?
[21:00] <jelmer> that's great
[21:03] <lifeless> https://launchpad.net/python-gpgfixtures
[22:08] <lifeless> jelmer: care to do a real simple review ? :)
[22:08] <lifeless> https://code.launchpad.net/~lifeless/launchpad/gpgme-egg/+merge/72366
[22:10] <jelmer> lifeless: ooh
[22:10] <jelmer> lifeless: I didn't realise 0.2 was out
[22:10] <jelmer> lifeless: +1
[22:11] <lifeless> thanks
[22:15] <lifeless> ok
[22:15] <lifeless> -not- what you want to find in every codepath using a test server:
[22:15] <lifeless>         sleep(0.02)
[23:11]  * wallyworld_ is off to visit the bank armed with a baseball bat
[23:16] <lifeless> wallyworld_: ?!
[23:45] <wgrant> 926	+            cls, 'PROJECT', 'Product',
[23:45] <wgrant> 927	+            'Display search results associated with products')
[23:45] <wgrant> :(
[23:46] <wgrant> 937	+            cls, 'PROJECTGROUP', 'Project',
[23:46] <wgrant> 938	+            'Display search results associated with projects')
[23:46] <wgrant> :(
[23:46] <lifeless> isn't that wrong ?
[23:46] <wgrant> Yes.
=== almaisan-away is now known as al-maisan
=== al-maisan is now known as almaisan-away
[23:58] <mwhudson> "Though there is work going on to demoralise the data to make the DSP queries fast"
[23:58] <mwhudson> best typo evah