IRC log of #schooltool for Tuesday, 2013-01-15

*** menesis has quit IRC00:01
*** veloutin has quit IRC00:02
*** replaceafill has quit IRC00:50
*** paulproteus_ has joined #schooltool02:58
*** paulproteus has quit IRC03:04
*** pgulley has quit IRC06:35
*** menesis has joined #schooltool10:14
*** menesis has quit IRC12:21
*** veloutin has joined #schooltool14:11
*** pgulley has joined #schooltool14:32
*** replaceafill has joined #schooltool14:38
*** veloutin has quit IRC14:38
*** veloutin has joined #schooltool14:38
*** menesis has joined #schooltool14:40
replaceafilldamn! changing query_all to execute_script + jquery improves iep test time from ~300s to 40s :|14:53
yvlpaste? :)15:01
replaceafill?15:01
yvlcode :)15:01
replaceafillah15:02
yvlvery curious15:02
replaceafillhttp://pastebin.com/uPpHaRV615:02
replaceafillfull test is at:15:02
replaceafillhttp://bazaar.launchpad.net/~schooltool-owners/schooltool.cando/trunk/view/head:/src/schooltool/cando/browser/stests/iep_scr.txt15:03
replaceafill(took me a while to find the url) :D15:03
replaceafilli was too curious, so i set up some timestamp15:04
replaceafilland noticed most of the time was being spent on that function15:04
replaceafillskill_events.txt (244.368 s)15:05
replaceafilllabel_title_sorting.txt (183.502 s)15:05
replaceafillfor these, i'm blaming the pprint helper for the gradebook15:05
yvlhmm15:05
replaceafillskill_events_importer.txt (239.912 s)15:06
replaceafillthe rest are ~1minute15:06
yvlif you have the test set up and ready15:07
yvlcould you try using browser.driver.find_element_by_css(sel)15:07
replaceafillah15:07
replaceafillsure15:07
yvl(should be identically slow)15:07
replaceafillto confirm it's not testing/selenium.py, right?15:08
yvlyes15:08
yvlI also wonder if replacing row.query_all.tag('td') with jquery script execution speeds up things15:09
replaceafilltrying:15:12
replaceafill    ...     for row in browser.driver.find_elements_by_css(sel):15:12
replaceafill    ...         tds = row.query_all.tag('td')15:12
replaceafillnow15:12
replaceafilloops15:12
replaceafill:15:13
replaceafill:|15:13
replaceafill    AttributeError: 'ChromeWebDriver' object has no attribute 'find_elements_by_css'15:13
replaceafillah15:15
replaceafillcss_selector15:15
yvlright15:15
replaceafillah15:16
replaceafilli can't use row.query_all15:16
replaceafillafter the find_elements call15:17
replaceafillbecause is returning webdriver webelements15:17
replaceafillnot testing.selenium ones15:17
replaceafill(i think)15:17
replaceafillAttributeError: 'WebElement' object has no attribute 'query_all'15:17
yvlyes15:18
yvlyou'd need to wrap it into15:18
yvlWebElementQuery15:19
yvlbrowser does that:         self.query = WebElementQuery(15:19
yvl            self.driver, single=True, browser=self)15:19
yvl        self.query_all = WebElementQuery(15:19
yvl            self.driver, single=False, browser=self)15:19
yvlah15:19
yvlbrowser.query_all._wrap(result)15:19
replaceafill:O15:20
yvlfind_elements_by_css returns plain Selenium objects15:20
replaceafillright15:21
replaceafillyep, similar result:15:24
replaceafill /home/replaceafill/sandboxes/va_reports/schooltool.cando/src/schooltool/cando/browser/stests/iep_scr.txt (291.469 s)15:24
replaceafillfor row in browser.driver.find_elements_by_css_selector(sel):15:24
replaceafilltds = row.find_elements_by_tag_name('td')15:24
replaceafilli'll stick with jquery :D15:25
yvlcan you do one more test please?15:26
replaceafillsure15:26
yvlchecking if .tag is slower than it's jquery counterpart15:26
yvlfor row in browser.driver.execute_script('return $(arguments[0])', sel):15:27
replaceafillyou mean wrapping "row" in my last example above?15:27
yvltds = row.query_all.tag('td')15:27
replaceafillbut in that case, row doesn't have query_all15:28
yvlsorry, yes15:28
replaceafillbecause it's a webdriver webelement15:28
yvltds = brwoser.query_all._wrap(row).query_all.tag('td')15:28
replaceafillkk15:28
yvlthanks!15:28
replaceafillwe're all very interested in improving our test times! ;)15:29
replaceafillour coverage, not so much :P15:29
yvl:DDD15:29
replaceafilliep_scr.txt (296.162 s)15:38
replaceafillusing the _wrap approach15:38
yvlso... .tag kills it?15:42
yvlhow many rows are there?15:42
replaceafillhhmm like 1415:44
yvlhmm, we definitely need to at least make some tests with common queries15:44
yvlbrowser.query.css, .tag and others15:44
replaceafillwhat do you mean, we need to *use* those?15:45
yvlsorry15:45
yvlI meant to test against jquery and see what cases are slow15:45
replaceafillah15:45
yvland if there are cases that are way slower15:45
replaceafilli kind of think jquery will beat them all...?15:45
replaceafillah15:46
replaceafillyou want the "waaaay" part15:46
yvlright15:46
yvlif it's 10x slower, it's not good15:46
yvlreason to hack in something in core15:46
yvllike if SOME_CONFIG.QUICK_TEST_HAKK_ENABLED15:47
yvluser jquery :)15:47
replaceafill:D15:47
replaceafillbut if browser.driver.find_elements_by_* are equally slow15:47
replaceafilli blame webdriver15:48
replaceafillnot testing.selenium15:48
replaceafillin the meantime, is it ok if i (ab)use execute_script + jquery?15:49
yvlwell...15:49
yvlcan you hack testing.selenium for now?15:49
yvlreplace css = proxy_find_element("css_selector")15:50
yvlwith15:50
yvldef css(self, param):15:50
yvl   return self.execute_script15:50
replaceafillah, you mean, put execute_script + jquery in testing.selenium?15:50
yvlyes15:51
replaceafillsure15:51
yvloh, and you might want to wrap the results15:52
yvlreturn self._wrap(self.execute_script(...))15:52
replaceafillah, true15:52
replaceafillso we have all the niceties of testing.selenium15:53
yvlyes15:54
yvland it would be transparent to all other tests15:55
replaceafillshould i land that change to trunk?15:55
replaceafillor my own branch for later review?15:55
yvleither way15:55
replaceafillkk15:56
yvlbut it would be good to have an option not to rely on jquery being there15:56
replaceafilli can dare to set up the config option :)15:56
yvl:)15:56
yvlyes15:56
yvlor at least...15:56
replaceafillif config option is enabled, use jquery15:57
yvladd .use_jquery to Browser15:57
replaceafillah15:57
replaceafilleasier :D15:57
yvlyes :D15:58
yvlyou can also add a config option15:58
* yvl won't mind ;)15:58
replaceafillwill try!15:59
replaceafillthanks yvl, this really helped15:59
yvlthanks replaceafill!16:01
* yvl had no idea selenium was *that* much slower16:02
*** pgulley has quit IRC16:12
*** paulproteus_ has quit IRC17:22
*** paulproteus has joined #schooltool17:30
replaceafilli wonder why "grep -r foobar parts/omelette/schooltool" is not working on 12.10...17:35
replaceafillit used to work in 11.10 iirc17:36
yvlodd17:42
yvlalso: I need to upgrade to 12.1017:42
yvlnow running 12.04...17:42
replaceafilli was blaming omelette, but i think it's not it17:42
replaceafillgrep works on the vps running 10.04 :/17:43
replaceafillwell, i'll use ../ notation ;)17:43
replaceafillah17:52
replaceafillhttps://bugs.launchpad.net/ubuntu/+source/grep/+bug/104965917:52
replaceafill:)17:52
replaceafillgrep -R foobar parts/omelette/schooltool17:52
yvloh :)17:54
*** ignas has joined #schooltool18:03
*** replaceafill has quit IRC18:19
*** replaceafill has joined #schooltool18:28
replaceafillyvl, i assume you're gone... :)18:56
ignasreplaceafill, your assumption is correct ;)19:09
replaceafill:D19:10
*** menesis has quit IRC19:53
*** ignas has quit IRC21:20
*** menesis has joined #schooltool21:49
*** menesis has quit IRC22:42
*** menesis has joined #schooltool22:42

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