=== chihchun_afk is now known as chihchun | ||
=== chihchun is now known as chihchun_afk | ||
=== chihchun_afk is now known as chihchun | ||
Saviq | elopio, hi, it's your favourite I-bug-you, any idea how to get rid of \ in https://github.com/Saviq/nova-compute-lxd/pull/3/files#diff-c80fca5016bdd3c8916dac9e8ba9a9fcR52 ? | 15:11 |
---|---|---|
Saviq | I tried everything I could think of with (), but no go :/ | 15:11 |
elopio | Saviq: many patches, that smells like not-so-easy to test code. | 15:12 |
elopio | Saviq: but, you can make a patch, and then start it | 15:12 |
elopio | instead of putting it inside the with statement. | 15:13 |
Saviq | elopio, yeah i was considering that, but that works and am quite happy, the only problem is I've no idea how to wrap without \ | 15:13 |
elopio | Saviq: well, \ is not wrong. | 15:13 |
Saviq | elopio, sure, was just wondering if there's a solution :) | 15:14 |
Saviq | elopio, fwiw, here's the tested function https://github.com/Saviq/nova-compute-lxd/blob/travis/nclxd/nova/virt/lxd/container_config.py#L50 | 15:14 |
Saviq | there's a lot of self.foo() calls, hence all the mocks... | 15:15 |
elopio | Saviq: ok, give me some moments and I'll check it. | 15:15 |
Saviq | I could move the patches a level up, tried to keep the test low level, though | 15:16 |
Saviq | elopio, thank | 15:16 |
Saviq | s | 15:16 |
=== chihchun is now known as chihchun_afk | ||
elopio | Saviq: sorry, long meeting and then forgot about you. | 16:47 |
elopio | Saviq: why do you have to patch something like _init_container_config | 16:48 |
elopio | doesn't seem to be slow, or to have any side-effects | 16:48 |
elopio | it's an internal method, so you probably shouldn't write a unit test for it, but check it's behaviour through the public method that calls it. | 16:50 |
elopio | yes, too many mocks. That usually happens when you try to do full coverage, but don't follow tdd. | 16:54 |
elopio | Saviq: I would recommend to split the tests. I use a trick that if I can't properly name the test, it's probably wrong. | 16:55 |
elopio | write first a test that's named like: test_configure_container_with_negative_memory_must_not_limit_memory | 16:56 |
elopio | then write test_configure_container_with_positive_memory_must_limit_memory. | 16:57 |
elopio | try passing to those methods a flavor that causes the if mem >= 0 to be taken, and a flavor that doesn't. And then check the container_config returned. | 16:57 |
elopio | afai can see, you shouldn't need a mock to test that. | 16:58 |
Saviq | elopio, right, test for _init_container_config is probably overkill | 17:12 |
Saviq | elopio, and yeah, unfortunately I'm sticking tests on all that post-factum | 17:12 |
Saviq | mocking add_config probably doesn't make sense either, now I think of it | 17:16 |
elopio | Saviq: appart from configure_container, the rest of the method seem internal to me. | 17:39 |
elopio | maybe ask why are they public? | 17:39 |
Saviq | elopio, could be indeed, will check if they're even called anywhere et | 17:39 |
balloons | bunosera Letozaf_ ! | 19:37 |
Letozaf_ | buonasera balloons :) howzit ? | 19:38 |
balloons | excellente. I was just talking with Akiva about the AP plugin | 19:38 |
balloons | I was just thinking about those bugs you found.. do you mind filing them? | 19:38 |
Letozaf_ | balloons, I will, I was just fighting getting Thunderbird to work, but I will just now | 19:39 |
Letozaf_ | balloons, bug 1474108 | 19:50 |
balloons | bug #1474108 | 19:57 |
Letozaf_ | balloons, :-P forgot # | 19:59 |
balloons | Letozaf_, the bot doesn't love us today.. No linky or print | 20:00 |
Letozaf_ | balloons, :-) | 20:03 |
Letozaf_ | balloons, bug #1474117 and bug #1474119 | 20:29 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!