IRC log of #schooltool for Monday, 2011-03-21

*** alga has quit IRC02:13
*** replaceafill has joined #schooltool04:39
*** replaceafill has quit IRC08:13
*** replaceafill has joined #schooltool08:20
replaceafillaelkner, zyt?08:21
replaceafillno javascript in ftests means we pass a08:21
replaceafillquery string08:21
replaceafill>>> + '?schoolyear=2004-2005')08:21
replaceafillyou can change the value of the dropdown and the call manager.getForm().submit()08:22
aelknerah, i see08:22
replaceafilli try to avoid open calls in ftests08:23
aelkneri was looking at your splitup of the gradebook tests, but you didn't change that part08:23
aelknerso i didn't think it was changable08:23
replaceafillwhat part?08:23
aelknergradebook_management.txt has a lot of open calls08:23
* replaceafill goes to see...08:24
replaceafillaelkner, i only see 3 ;)08:25
replaceafilland they are needed because there's no way to set those parameters using a form control08:26
aelknerso where do you use .getForm().submit()?08:26
aelkneri only see one case of it08:28
aelknerbut i'm looking at the egg08:28
aelknerlet me check my recent checkout of trunk08:28
replaceafilllook at trunk08:28
aelknerah, good, lots of examples08:29
aelknerthanks for the tip08:29
* replaceafill is learning about administrative divisions of cambodia...08:31
aelknerhow the government is structured?08:31
replaceafillthere were some terms i didnt understand in the census :D08:32
aelknerlike their words for provinces and municipalities08:32
aelknerso many ks08:33
aelknerabd hs08:33
aelknerkhan i have some khotten khandy?08:34
*** yvl has joined #schooltool08:44
aelkneryvl, hey09:10
yvlhey aelkner09:13
aelknerobviously, i'm going to bed soon, but i was hoping to get your reaction to my note real quick09:14
aelknerdo you think you'll have a chance to set up the trunk checkout and create a message there?09:15
aelknerif you can just see the problem yourself, then i'll know that i'm not going crazy09:15
yvlI'm doing that right now09:16
yvlproblem reproduced09:16
yvlyou're not crazy :)09:16
aelknerstrange, isn't it?09:16
yvlyou'll need to manually ping persistence09:19
yvlaccessing __dict__ directly doesn't change _p_state of the object09:19
yvlfor messages and goals09:19
aelknerin evolve7?09:19
yvlwhat happens is that you change the object in memory09:20
yvlbut it's not persisted back09:20
yvlgimme a moment09:20
aelknerok, great09:20
aelkneris it dir(obj)?09:30
aelkneri found that in evolve409:30
yvlyou'll need to invoke setattr of the message and the goal09:30
aelknerah, setattr09:30
aelknerobj._persons_responsible = obj.__dict__['persons_responsible']09:31
yvlsomething like message.___just_ping_persistence09:31
aelknerthat di that09:31
yvldel message.__dict__['____just_ping_persistence']09:31
aelknermessages don't have such an attribute09:31
aelkneror do they because they inherit from Persistence?09:32
yvlit's a random name09:32
yvlif they have titles or somehting, you can also do09:32
yvlmessage.title = message.title09:32
aelknerthis seems hokey09:33
yvlyou can't do that with properties however09:33
aelknerso, usually on changes an attribute and has no problem09:33
aelknerbut in this case, the properties are changind09:33
aelknerand that doesn't result in setattr calls09:34
aelknerand neither does del message.__dict__['sender']?09:34
aelknerbecause i do that already09:35
yvlthe properties are not changed09:35
yvlthey are defined in class09:35
aelknerthey are class methods that result in calls to relationship methods, right?09:37
aelknerso setattr is left out of the equation09:37
aelknerok, thanks09:40
aelknercould you do me a favor and run the ftest coverage09:40
aelkneractually, even easier09:40
aelknerjust put a pdb break after the if obj in util: in updatePersonsResponsible09:41
aelknerand do a bin/test -f09:41
aelknerit never reaches there, even though i have a special test file to prove that changing persons_responsible09:42
aelknerchanges the index09:42
aelkneryou'll note that i created a unit test for the same method, but those things get crazy some times09:42
aelknerwith having to stub out half of the objects09:42
aelknerhaving an IntId utility that is predictable with it's intids09:43
aelknerand that works the same way as the real thing is tricky09:43
aelkneranyway, if i don't check if obj in util: the unit test crashes09:44
aelkneri might be off base with that, i don't know09:44
yvlwell, if you need to stub that much it kind of shows how complicated this method actually is09:45
yvlor how much it assumes09:45
yvlso tests there are a good indicator09:45
yvlaelkner, I'll email you later today09:46
aelknerwell, partly it assumes the complex data file that it will find in a real running environment09:46
yvlif that's ok with you09:46
yvlit's not a data file issue09:46
yvlit's software design issue09:46
aelknerthat's dine, and we'll talk at the meeting, too09:47
yvland I was not saying that design is bad09:47
yvljust that tests show how much (or little) the method assumes09:47
aelknerwell, the method is actually simple, but the server needs lots of complicated uilities and such09:48
aelknerit's not special to any method, most of them do09:48
aelknerone always is doing a queryUtility09:49
aelknerand one assumes that they can find the typical ones09:49
aelknerCatalogs (before)09:49
aelkneri can't remember what else at the moment09:49
yvlgood point09:50
aelknerpoint is all these things are hooked up together09:50
aelknerthey depend on each other, and it's a pain in the ass09:50
aelkneri mean i haven't even mentioned the need for an app09:50
aelknerand the folders that go under it09:50
aelknermost code that does anything meaningful ties together these pieces09:50
aelknerso they all need to be stubbed09:51
aelknerit would be better if we had a more standard way od creating the stubbed environment09:51
aelknerrather than reconceiving how to stub every time one wants to write a unit test09:51
aelknerit's a waste of time in my opinion09:53
yvlI agree :)09:53
yvlthat's what I meant by good point09:53
aelknerdidn't mean to belabor it :)09:53
yvlthen again - that's why we have setUp methods in tests09:54
yvlthey create the relevant part of environment09:54
aelknerthat's the re-conceiving thing i was talking about09:54
yvlbut you usually want to create as little as possible09:54
yvlbecause, for one, tests that need a lot of set-up run slow09:55
aelkneryou know what might help09:55
yvlmore importantly - this means that both code and tests depend on many things set up somewhere else09:55
aelkneragain my point about meaningful code having a knack for linking many parts together09:56
yvlsay, updatePersonsResponsibleIndex09:57
yvlthis one updates specific catalog, so we need to set up that09:57
yvland it's there because of relationship property09:58
yvlso we need to set up relationships09:58
yvlit also relies on objects providing one of two given interfaces09:58
yvlso we need to stub that09:58
aelknerdon't forget the trickiest part, the IntIds utility09:59
aelkneranyway, i did all of that, but it's pain is all09:59
aelknerplease look into why my functional test for the catalog change works even if the method does nothing10:01
yvlbut later today, please10:01
aelknernp, i'm going to sleep now10:01
yvlgood night :)10:02
*** menesis has joined #schooltool10:35
*** replaceafill has quit IRC10:36
*** alga has joined #schooltool11:24
*** ignas has joined #schooltool12:36
*** ignas has quit IRC13:39
*** ignas has joined #schooltool14:11
*** jelkner has joined #schooltool14:22
*** menesis has quit IRC14:57
*** th1a has joined #schooltool15:25
*** replaceafill has joined #schooltool15:26
th1ahi replaceafill, aelkner, yvl.15:30
replaceafillgood morning/afternoon15:30
th1aWould you like to start us off replaceafill?  Learn anything particularly useful at PyCon?15:32
replaceafillpyramid is getting popular :)15:32
th1aWhat do people like about it?15:33
yvlmorning guys15:33
replaceafillit's "easy" and zope people like it has done well what zope did wrong15:34
replaceafillthere was a very interesting open space about zope15:34
replaceafillwith all the big names talking about what went wrong15:34
replaceafillmy report:15:35
replaceafilli merged the views to manage students and teachers in a class in cambodia15:36
replaceafilland started to implement the 'disconnect subjects from levels' feature15:36
replaceafillbut now i have to ask (again) how that will affect the average calculations15:36
*** menesis has joined #schooltool15:36
replaceafill(i already asked that but have no answer)15:36
th1ahi menesis.15:37
replaceafilland im preparing a very long email with lots of questions about the many reports i've got recently15:37
th1aYes, lots of sample reports generate lots of questions.15:37
replaceafilli also met with matt gallagher and david welsh this week15:37
replaceafillthey were trying to enable cando + other plugins15:38
replaceafilli also found this:
replaceafill(it's in spanish)15:38
replaceafillit's the announcement that schooltool will be in natty15:38
replaceafillwhich got me in touch with Franco Ontivero, who i've been helping to set up his schooltool instance15:39
th1aGood catch.15:40
replaceafillalso, i'm almost ready to attend the sugar summit15:40
th1aBags packed?15:40
replaceafillwill ask you in a future meeting about what topics should i talk about there15:40
replaceafillno, not yet15:40
menesisalso, see
menesisabout the same15:41
replaceafillalso, jelkner and his team is helping setting up an XS with aks RPMs to demonstrate maybe in the summit15:41
replaceafilland this week i should start with the census forms for cambodia's primary and secondary schools15:42
replaceafilland i'd have some questions, but was thinking maybe i could meet with yvl tomorrow or on wednesday, if yvl has time of course15:43
yvlfor you - always :D15:43
replaceafillbecause there are some design stuff i want to ask you about :)15:43
yvl(and by you I meant all of you)15:43
replaceafillth1a, to finish my report, i'm reviewing the reports chandara sent last night and will try to send all my questions in one batch15:44
replaceafillwith numbers15:44
*** ignas has quit IRC15:44
replaceafillso i can say "you didnt answer #20"15:44
th1aSounds good.15:45
replaceafilli guess that's it from me15:45
th1aThanks, replaceafill.15:45
replaceafillyvl, i'll ask you about times after the meeting, ok?15:46
yvlI finished "view" views for former timetable schemas15:46
yvland wrote evolution for the schemas15:47
yvlthis week the primary target will be section scheduling15:47
yvlsecondary (but there won't be enough time to finish) - calendar events15:48
yvlthat's it.15:48
th1aDoes that put you on schedule?15:48
aelknerdon't gorget help me out :)15:48
yvlthat goes without questioning :)15:48
yvlyes, th1a15:48
aelkneri bent yvl's ear quite a bit last week15:49
th1aThanks, yvl.15:49
aelknerso last week i had to work on changing the intervention catalog to new style15:49
aelknerit was worth it for sparing us evolution every time the catalog changes15:50
aelknerit had to change it to index differently for persons_responsible anyway, so...15:50
aelkneri created a new subscriber for when that attribute is changed, and unit tested it15:51
aelknerthen when i put in a functional test for changing persons_responsible15:51
aelknerthe test worked great, if i removed a teacher from a goal, they didn't see it in the inbox15:52
aelknerputting them back made the goal appear again15:52
aelknerit wasn't until i ran ftest coverage on it that i realized that the code wasn't even run15:53
aelknerso the index is updated without the subscriber even running15:53
yvlif you run functional tests, the updatePersonsResponsible is used15:54
yvlsame goes if you run: make ftest-coverage15:54
aelknerdid you see the three lines that are not reached?15:55
yvlsorry, no, will check now15:56
aelknerthey come after if obj in util:15:56
aelkneri needed to make sure the object was in the intid utility rather than assuming it15:56
aelknerand it always seem to not be there, so it doesn't actualy reach the reindex line15:57
aelkneri can discuss this with yvl after the meeting15:57
yvlyou should have used util.queryId15:58
yvlinstead of if object in util15:58
aelknerthere was also a scary evolve issue which yvl and i discussed last night15:58
aelknerand i should be able to ix it by forcing the persistence mechanism to fire for each object15:59
aelkneralthough, how to test that is another thing since we use stubs15:59
aelknerif i say message.title = message.title, for instance15:59
aelknerthat may fix the evolve bug15:59
yvlI'd like to exand on this for a few seconds16:00
th1aWe've got time.16:00
aelknerbut if the message is a stub in the test, then i can't test that the persistence engine fired16:00
yvlpersistent objects are a bit finicky16:00
yvlthey exist in ghost (unloaded) state until you actually try to read from them16:01
yvlalso, they are saved back to the database only when they consider themselves 'changed'16:01
yvlif you look at fixMessage from the code above16:01
yvlyou'll notice it tries to access and modify __dict__ directly16:02
yvl__dict__, like __class__, __of__, __del__ and... __setstate__ IIRC,16:02
yvlare treated in a special way16:02
yvlthey do not unghostify the object16:03
yvlwhich means - until you try to read some other attribute, the object will not be loaded16:03
yvlfinicking with __dict__ directly does not make the object 'changed'16:04
aelknerso i have learnered!16:04
yvlthe hard way ;)16:04
aelknerhow to test?16:04
yvlyou can check if _p_changed is set to True16:04
yvlfor those objects16:04
aelknerwith stubs thaqt don't inherit from Persistent?16:05
yvlno, it won't work with them16:05
yvlyou can't test if persistence mechanism was triggered for non-persistent objects16:05
aelknerso i need to change my stubs to inherit from Persistent, right?16:05
aelknerand i can cahnge for _p_changed16:06
aelknertest for16:06
yvlprobably yes16:07
aelkneri'll try that out today and report my findings tonight16:07
yvlbut check if _p_changed is not True at the beginning16:07
yvlif you can't do a quick fix, just don't test16:07
yvlideally it would be best to set the old object, commit a transaction16:08
yvlthen execute evolve16:08
yvlthen see if the object is changed16:08
yvlbut for the fix16:09
yvlyou do have several options there16:09
yvlone is to just bluntly use message.created16:09
yvlcreated = message.created16:09
yvlif 'sender' in message.__dict__:16:10
yvl   do stuff16:10
aelkneri thought it was message.created = message.created16:10
yvl   message.created = created16:10
aelknerin order for settatr to run16:10
aelkneroh, only do it if the object is gong to change16:10
yvlyes, that would be nicer16:10
aelkneranyway, what about the test stubs?16:11
aelknerinherit from Persistent?16:11
aelknerok, will do, and i'll test _p_changed16:11
yvlbut don't waste too much time on this16:11
yvlI mean - we should have decent infrastructure for this16:12
yvlbut evolution tests never got enough love :)16:12
yvlmaybe some time soon16:13
aelknerthey could use some love because this esoteric bug was a bad one16:13
aelkneranyway, moving on to updatePersonsResponsible16:13
yvland as I'm writing timetable evolution, I'm extremely interested in what got persisted16:13
aelknerit doesn't seem i even needed it for my new test to pass16:14
aelknerwhen my test changes persons_responsible using the goal edit view16:14
aelknerthe index is updated even though the reindex is not called in updatePersonsResponsible16:15
yvltry manually breaking the relationships16:15
yvland checking if the catalog reflects the new values16:15
aelkneryeah, i didn't test having the manger remove the teacher16:15
yvlnot from the views16:15
yvlunless you want to have the data model that breaks unexpectedly once somebody adds another view16:16
aelknerthe scenario is removing the teacher from the system altogether16:16
aelknerthat will cause the contact to go away16:16
yvlthe scenario you should test for is16:16
aelknerand that would call updatePersonsResponsible to fire16:16
yvlunrelating the goal and the contact16:17
aelknerthat's what i'm saying16:17
aelknerthe only way to unrelate them is removing the teacher form the system16:17
aelknerhow then?16:17
yvlbad Alan!16:17
yvlsorry :)16:18
yvlyou should test two things16:18
aelknerspeak to me16:18
yvl1)  - what you said16:18
yvlmanager deleting the contact, that in turn kills all relationships, this fires events, catalogs get updated16:18
yvlbut that is not enough16:18
yvlsomebody from code unrelates message and the contact16:19
aelknerthere is no code writen for that, so how to test?!16:19
yvlsomebody can write that cod16:19
yvlas a new view16:19
yvlas import script16:19
yvlI would probably do an "integration test"16:20
aelknerthere's no use case for an import script, no user calling for it16:20
aelkneryou're speaking theoretically16:20
yvlbut your code should test that16:20
yvlor - remove the code16:20
aelknerbut this is reality16:20
yvlyou want to have code that breaks once anybody writes anything reasonable?16:21
yvlthere is a method that does stuff16:21
aelknerso should i create a view that is registered only in ftesting.zcml16:22
yvlyou should test that it does stuff well16:22
aelknerthat changes the relationship?16:22
yvlthat is one option16:22
yvlthere is another option16:22
yvl[looking for example]16:22
yvldammit, can't find a good one on the sport16:23
yvlthere it is16:23
yvlmethod setUpSecurityDirectives16:24
aelknerthat's not a functional test16:24
yvlyou can have a separate unit test that includes the most important zcml you need16:24
aelkneri need a funcitonal test16:24
yvlyou need both16:24
yvla functional - that shows that everything works16:24
aelkneri already have the unit test16:24
yvlwhen users do their stuff16:25
yvlgood point16:25
yvlapologies, I totally forgot that16:25
aelknernp, so i create a test only view registered only in ftesting.zcml16:25
yvlah, right16:26
aelkneri call it using query string to change the relationship16:26
yvlthe test is broken16:26
aelknerwhat test is broken?16:26
aelknerhow is it broken?16:27
yvl__contains__ return True always16:27
yvlyou check if your_object in intid_util16:27
yvlwhich is never16:27
yvlbecause that's not how int id utilities work16:27
yvlthats out of scope for this meeting16:28
yvlfor now16:28
yvlchange the updatePersons* code16:28
yvlto use16:29
yvlint_id = util.queryId(obj)16:29
yvlif int_id is not None:16:29
yvl    ...16:29
aelknerand the stub?16:29
yvlfix it :)16:30
yvlfor example...16:30
yvlhave a dict of {id: object}16:30
yvland make queryId of the stub do:16:30
yvldef queryId(self, object, default=None):16:31
yvl    return the_dict.get(object, default)16:31
aelknerthe dict is keyed by the message object?16:32
yvland I'll keep in mind that we need decent helpers for int id testing16:32
yvlthat's what I get for writing in a hurry16:32
yvlyes, you can do that16:32
yvlor you can have a list of objects16:33
yvland return if object in list, list.index(object)16:33
aelkneryou'll admit that this is a total pain in the ass, yes?16:33
yvlof course!16:33
yvlit's not difficult, but it's pain16:33
yvlbut you know16:34
aelknerno, i disagree, it's VERY difficult16:34
yvlit's kind of our job to do that16:34
yvland it's my job to write helpers16:34
aelknerrocket science for making a blender run16:34
aelkneranyway, i'll give it another pass16:35
yvlI do agree that this is overkill16:35
yvllet's move on :)16:35
aelkneradditionally, i added lots of test coverage16:35
aelknerand updated README.txt to use more explicit XPATH tests16:35
aelknerremoving the old stephan pattern that i mistakenly followed16:36
aelknerno more print manager.contents16:36
aelknerth1a, at some point the package will need to be revisited to remove dependency on schooltool.gradebook16:37
aelkneradn at that point, there will be tests that will change anyway16:37
aelknerso i'll leave those uncovered line there until then16:37
th1aDidn't we decide that was near the top of your list?16:38
aelknermaybe, i don't remember16:38
aelkneri would prefer to do it soon while the project is fully loaded in my mind16:38
th1aYou can just continue into that if you want.16:39
aelknerfine, will do16:39
th1aOK, is that it for now, aelkner?16:39
aelkneri can write up something during the week and send to maling list16:39
jelknerquick question: aelkner will be available to help fsuftchi this wednesday from 2 to 7 pm, yes?16:39
aelknerjelkner, definitely16:39
yvlby the way, aelkner - I do appreciate you improving the codebase, you know ;)16:39
aelkneryvl, thanks, good to be appreciated16:40
aelkneri'd like to move the templates unto a templates directory as a small task16:40
aelknerkeep cleaning up the browser package16:40
replaceafillaelkner, is it worth to split the long README.txt ftest in intervention?16:41
aelkneri already split out the dashboard tests16:41
aelknerbut mostly README.txt tests the message/goal adding/editing16:42
aelknerand the intervention center16:42
aelknerand should stay as it is16:42
aelknerso. i think i've reported enough for one day :)16:43
aelkneri'll keep giving the package some love16:44
th1areplaceafill:  Should I be looking at Selenium 2?16:44
replaceafillth1a, there's a stable 2 already?!?!16:45
th1aOtherwise I wouldn't need to ask.  ;-)16:45
th1aBut beta2, right?16:45
replaceafillhaven't played with it yet :(16:46
replaceafillbecause of the beta status16:46
th1aSo I'm waiting to hear back from the design people (I called on Friday) and need to start figuring out my new Selenium strategy as inspired by replaceafill.16:46
th1aHave a great week gentlemen!16:47
menesisI have been somewhat blocked by Developer membership board16:48
th1aI couldn't fully interpret that last email.16:48
menesisthat is not functioning after latest elections on February, it seems16:48
menesisso I still don't have permissions to upload half zope packages and, most importantly, schooltool packages16:49
menesisbut I finally got a reply yesterday16:49
menesisshould be implemented sometime soon16:50
menesisI have been finalising zope packages16:50
menesisuploaded those that I can, left others for later16:51
menesissome work on zope upstream, fixing copyrights, dependencies etc., as I discover them when touching packages16:51
th1aOK.  Sounds good.16:52
menesisalso, preparing a beta release16:52
th1aJust started snowing here...16:52
menesisMarch 24th is beta freeze16:52
menesishave to update release notes, merge translations, and will make a beta release then16:53
aelknerweird, it's supposed to get to 58 degrees here today16:53
aelknernot far south from you16:53
menesisas I understand there are no new fixes or features in this beta release16:54
th1aOK, thanks menesis.16:54
th1aAny last questions?16:58
th1aHave a great week gentlemen.16:58
yvl(I've already talked to Douglas about being available on IRC)16:58
yvlgreat week to you, guys!16:58
* th1a drops the bag of gravel.16:58
replaceafillthanks everybody17:00
aelknergreat week everyone17:00
*** alga has quit IRC17:28
*** replaceafill has quit IRC18:16
*** replaceafill has joined #schooltool18:20
*** jelkner has quit IRC18:54
*** menesis has quit IRC21:09
*** replaceafill has quit IRC21:34
*** menesis has joined #schooltool21:52
*** th1a has quit IRC22:06
*** th1a has joined #schooltool22:08
*** menesis has quit IRC22:30
*** menesis has joined #schooltool22:44
*** alga has joined #schooltool23:30
*** menesis has quit IRC23:40

Generated by 2.15.1 by Marius Gedminas - find it at!