Monday, 2013-07-22

*** tpb has joined #timvideos00:00
*** Jahanzeb has quit IRC01:15
*** CarlFK has joined #timvideos01:24
*** Jahanzeb has joined #timvideos01:37
*** Jahanzeb has quit IRC01:58
*** hyades has quit IRC03:20
*** hyades has joined #timvideos03:34
*** mithro- has joined #timvideos03:37
*** mithro- has quit IRC03:43
*** hyades has quit IRC03:46
*** mithro- has joined #timvideos03:55
*** mithro- has quit IRC04:06
*** shenki_ has joined #timvideos04:16
*** CarlFK has quit IRC04:18
*** shenki has quit IRC04:18
*** CarlFK1 has joined #timvideos04:18
*** hyades has joined #timvideos04:23
*** mithro has joined #timvideos04:26
*** mithro has quit IRC04:45
*** mithro has joined #timvideos04:45
*** mithro has quit IRC04:50
*** mithro has joined #timvideos04:51
*** mithro has quit IRC05:17
*** mithro has joined #timvideos06:44
hyadesmithro: meeting in sometime?07:14
mithrohyades, yes07:14
mithrohyades,07:22
mithrojust looking through your latest round of code changes07:22
mithroIf you want the exception object07:22
mithroYou want to use07:22
mithroexcept Exception as e:07:23
mithrorather then pulling it out of exc_info07:23
mithrohyades, you also want to group the getters and setters together07:23
mithroIE the address setter and the address getter should be together07:24
hyadesok07:24
hyadesof a property?07:24
mithroyes07:24
mithroYour also pull the domain out and then never using it07:25
mithroI'm pretty sure Exception doesn't have a "domain" attribute07:25
mithroyour except class should be as specific as possible07:25
hyadesok...i was seeing exc_info that from gi/_glib/option.py07:25
hyadesyeah domain has no use07:25
mithroif I put a syntax error at line 127 in connection.py you'll get a connection error07:26
hyadeshow?07:26
mithrowhat do you mean how?07:27
hyadesthis part right?07:27
hyadesconnection = Gio.DBusConnection.new_for_address_sync(07:27
hyadestry:07:27
hyadesohhh07:28
hyadesthat was more of a typo07:28
hyadesit should be except GLib.GError07:29
hyadesi added it, maybe removed while testing07:29
mithrohyades, in the call now07:30
hyadesgive me 2 mins07:30
mithrohyades, the mark/check face stuff shouldn't probably be throwing a ConnectionError?07:33
mithrohyades, have to be quick today, I need to head to the airport in 30 minutes07:34
*** hyades_ has joined #timvideos07:38
mithro<mithro> hyades, have to be quick today, I need to head to the airport in 30 minutes07:38
hyades_im in07:38
mithrohyades, try dragging the bandwidth slider all the way down07:40
hyades_some problems07:40
hyades_connectivity07:40
hyades_ill try07:40
hyades_its full!07:41
mithrohttps://pypi.python.org/pypi/pytest-cov07:47
tpbTitle: pytest-cov 1.6 : Python Package Index (at pypi.python.org)07:47
mithrohyades, poke?07:49
hyades_im thr07:50
hyades_i can hear u07:50
hyades_mithro,07:50
mithrohyades, switch to text07:50
mithrohyades, do you have any questions about the upcoming mid-term evaluation?07:51
*** hyades__ has joined #timvideos07:51
hyades__mithro,07:51
mithro<mithro> hyades, switch to text07:51
mithro<mithro> hyades, do you have any questions about the upcoming mid-term evaluation?07:51
hyades__anything apart from blog post?07:52
hyades__like any  target?07:52
mithroso where do you think should be finished by then?07:52
hyades__where?07:53
hyades__didnt get you07:53
*** hyades is now known as Guest8369507:53
*** hyades__ is now known as hyades07:53
hyadesalso a bit of functionality of the code..07:54
mithrohyades, what do you want to have finished by the mid-term?07:54
hyadesits like in another 10 days07:55
mithroyes07:55
hyadesso can say most of exception handling07:55
*** hyades_ has quit IRC07:55
hyadesunittests i am not sure07:55
mithrohyades, btw pytest-coverage https://pypi.python.org/pypi/pytest-cov07:55
tpbTitle: pytest-cov 1.6 : Python Package Index (at pypi.python.org)07:55
hyadesyeah fine, i will use it07:55
mithrohyades, so what functionality do you have now?07:56
hyades1) The server processes07:57
hyades2) Test inputs07:57
hyades3) Dbus remote method calls (not tested)07:57
hyades4) Preview outputs07:57
hyadesthese four07:58
hyadesin a broad sense07:58
hyadesmithro, ping?08:01
mithrookay08:02
mithroso you need to show how your tests are working08:03
hyadescoverage should be 100%?08:03
mithrofor unittests08:03
mithrohyades, you should also have integration tests08:04
hyadestill mid-term?08:04
mithros/till/before/08:04
hyadesi cannot do unittests if Exception handling is not done..08:05
mithrohyades, probably08:06
hyadesi am not sure both and integration tests can be done till mid-term08:06
hyadesi will mostly complete exception handling and unittests till then..08:07
mithrowhy?08:08
hyadesthe unittests take time :/08:08
mithroI have to go08:08
mithroyou have 40 hours a week08:09
hyadesi will try adding08:09
hyadesi will ask you about integration tests later when i come to them ..08:09
hyadesmithro, anything else?08:12
*** mithro has quit IRC08:13
*** hyades_ has joined #timvideos08:16
*** hyades has quit IRC08:17
*** hyades_ is now known as hyades08:37
*** bananadine has joined #timvideos09:38
bananadinehey guys09:47
bananadinewhere did mithro go?09:47
hyadeshe had some flight10:06
bananadineoh10:08
bananadinewe had a weekly meeting scheduled for now10:08
hyadesoh12:01
*** hyades has quit IRC12:05
*** hyades has joined #timvideos12:49
*** mithro has joined #timvideos13:05
bananadinehi mithro, we didn't have a vido chat today13:54
hyadesmithro, achieving 100% coverage is not possible14:02
hyadesi have exceptions like OSError for which I cannot design a test case14:02
CarlFK1hyades: I don't know if it is needed, but you can write code that raises an OSError - getting that code to run in place of say f=open(x) takes some work, but at least it is possible14:08
hyadesfor these ones i have written test cases14:09
hyadesbut some things like killing a process may raise a OSError14:09
hyadesfor which I cannot have a test case14:09
CarlFK1um.. you can.. it is just work.14:10
CarlFK1here is how I override python's open function: https://github.com/CarlFK/veyepar/blob/master/dj/scripts/archive_uploader.py#L1414:11
tpb<http://ln-s.net/-YWl> (at github.com)14:11
CarlFK1not for testing, but I could do something similar14:11
CarlFK1where is your code that kills a process?14:12
hyadeshttps://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/server.py#L19514:13
tpb<http://ln-s.net/-YWo> (at github.com)14:13
hyadeshttps://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/server.py#L21714:13
tpb<http://ln-s.net/-YWs> (at github.com)14:13
hyadeseven this14:15
hyadeshttps://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/server.py#L16314:15
tpb<http://ln-s.net/-YWy> (at github.com)14:15
*** hyades has quit IRC14:31
*** bananadine has quit IRC14:43
*** hyades has joined #timvideos14:59
*** hyades has joined #timvideos15:00
*** CarlFK1 is now known as CarlFK15:00
*** hyades_ has joined #timvideos15:16
*** hyades has quit IRC15:18
hyades_CarlFK, any solution?15:26
*** hyades_ is now known as hyades15:26
CarlFKhyades:   http://bpaste.net/show/ekX6mkRqWS6ZzGobUDPd/  server.os.kill = fake_kill15:27
tpbTitle: Paste #ekX6mkRqWS6ZzGobUDPd at spacepaste (at bpaste.net)15:27
CarlFKThat's the first time I have coded such a thing, so I have no idea if that is the best way or not.. just shows it can be done15:28
hyadesahh nice :)15:28
*** mithro has quit IRC15:51
hyadesCarlFK, https://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/test_server.py#L9415:51
tpb<http://ln-s.net/-Y_i> (at github.com)15:51
hyadesthanks for that hint15:51
CarlFKyay :)15:53
*** hyades has quit IRC16:04
*** hyades has joined #timvideos16:07
*** Jahanzeb has joined #timvideos16:45
*** Jahanzeb has quit IRC17:51
*** micolous has quit IRC17:58
*** hyades has quit IRC18:17
*** hyades has joined #timvideos18:30
*** hyades has quit IRC19:00
*** hyades has joined #timvideos19:12
*** hyades has quit IRC19:18
*** hyades has joined #timvideos19:35
*** hyades has quit IRC19:56
*** hyades has joined #timvideos20:09
hyadesCarlFK, unittests should not use any other modules of my code right?20:34
CarlFKhyades: that sounds more like a goal than a rule20:36
hyadesCarlFK, https://github.com/hyades/gst-switch/blob/python-api/python-api/gstswitch/connection.py#L11720:37
tpb<http://ln-s.net/-Yiw> (at github.com)20:37
CarlFKI think it depends on how well the code being tested is written - how isolated is each function20:37
hyadeshere i make a connection20:37
hyadesbut for making connection , i need a server20:38
hyadesrunning20:38
hyadesand later i call remote methods, for which i gain need server+connection20:38
hyadess/gain/again20:39
CarlFKso anther issue is figuring out what you do and don't need to test20:40
CarlFKlike you don't need to test that the TCP/IP stack in the OS works -  we can just assume it does20:40
hyadesyeah..20:41
CarlFKGio.DBusConnection.new_for_address_sync - someone else wrote that, you just call it, right?20:41
hyadesits present!20:41
hyadesi didnt write20:42
CarlFKfrom gi.repository import Gio, GLib20:42
CarlFKright .. so I think it is safe to assume it works20:43
hyadesso i test these in integration tests?20:43
CarlFKand if it needs testing, it should have it's own test, not rely on             gst-switch / python-api / gstswitch / connection.py20:43
CarlFKI am putting it in the same category as the network stack20:43
hyadesya similar20:43
hyadesit makes dbus connection etc.20:44
CarlFKbut you do need to test the code you wrote :  def connect_dbus(self):20:44
CarlFKyou are calling new_for_address_sync with 4 parameters20:45
CarlFKaddress, flags, none, none20:46
hyadesfor that self.address has to be set to something meaning-full20:46
CarlFKwhen you run a test, address and flags will always be the same, right ?20:46
hyadesif gst-switch-srv runs, it is "unix:abstract=gstswitch"20:47
CarlFKthats the value of address ?20:47
hyadesyes20:48
CarlFKwhat will the value for flags be ?20:48
hyadesand to test this, i need something at that address running20:48
hyadesits constant20:48
CarlFKagain, for a single test - you may need more than one test20:48
CarlFKwhat will the value ?20:50
hyadesCONNECTION_FLAGS = Gio.DBusConnectionFlags.AUTHENTICATION_CLIENT20:50
CarlFKk20:51
CarlFKso make a fake new_for_address_sync that takes 4 parameters20:51
hyadesk.20:52
CarlFKlike def new_for_address_sync( p1, p2, p3, p4 ) :20:52
*** Jahanzeb has joined #timvideos20:52
CarlFKif p1=="unix:abstract=gstswitch" and p2==Gio.DBusConnectionFlags.AUTHENTICATION_CLIENT and p3 is none and p4 is none: return fake_connection()20:53
CarlFKelse: raise .. um.. BadTestParaeters or something20:53
CarlFKNot even sure you need to bother checking20:53
CarlFK return fake_connection()  is the important part20:54
hyadeswhr shud thiscode come in?20:55
CarlFKit is part of the test, so wherever that code lives.. (i think)20:57
CarlFKlook this over https://pypi.python.org/pypi/mock20:57
tpbTitle: mock 1.0.1 : Python Package Index (at pypi.python.org)20:57
CarlFKwell, hold..20:57
CarlFKso you have some fake_connection() function that gets stored to self.connection20:58
CarlFKlets back up a bit...20:59
hyadesok20:59
CarlFKto get full coverage, you need to test     def connect_dbus(self): twice21:00
CarlFKonce that ...21:00
CarlFKhole...oohe21:00
CarlFKphone call21:02
* hyades can sleep off any time21:30
CarlFKabvout dome...21:41
*** hyades has quit IRC22:25
*** Jahanzeb has quit IRC22:33
*** Jahanzeb has joined #timvideos22:35
*** CarlFK has quit IRC23:00
*** parx has quit IRC23:12
*** parx has joined #timvideos23:19
*** CarlFK has joined #timvideos23:36

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