*** menesis has quit IRC | 00:01 | |
*** veloutin has quit IRC | 00:02 | |
*** replaceafill has quit IRC | 00:50 | |
*** paulproteus_ has joined #schooltool | 02:58 | |
*** paulproteus has quit IRC | 03:04 | |
*** pgulley has quit IRC | 06:35 | |
*** menesis has joined #schooltool | 10:14 | |
*** menesis has quit IRC | 12:21 | |
*** veloutin has joined #schooltool | 14:11 | |
*** pgulley has joined #schooltool | 14:32 | |
*** replaceafill has joined #schooltool | 14:38 | |
*** veloutin has quit IRC | 14:38 | |
*** veloutin has joined #schooltool | 14:38 | |
*** menesis has joined #schooltool | 14:40 | |
replaceafill | damn! changing query_all to execute_script + jquery improves iep test time from ~300s to 40s :| | 14:53 |
---|---|---|
yvl | paste? :) | 15:01 |
replaceafill | ? | 15:01 |
yvl | code :) | 15:01 |
replaceafill | ah | 15:02 |
yvl | very curious | 15:02 |
replaceafill | http://pastebin.com/uPpHaRV6 | 15:02 |
replaceafill | full test is at: | 15:02 |
replaceafill | http://bazaar.launchpad.net/~schooltool-owners/schooltool.cando/trunk/view/head:/src/schooltool/cando/browser/stests/iep_scr.txt | 15:03 |
replaceafill | (took me a while to find the url) :D | 15:03 |
replaceafill | i was too curious, so i set up some timestamp | 15:04 |
replaceafill | and noticed most of the time was being spent on that function | 15:04 |
replaceafill | skill_events.txt (244.368 s) | 15:05 |
replaceafill | label_title_sorting.txt (183.502 s) | 15:05 |
replaceafill | for these, i'm blaming the pprint helper for the gradebook | 15:05 |
yvl | hmm | 15:05 |
replaceafill | skill_events_importer.txt (239.912 s) | 15:06 |
replaceafill | the rest are ~1minute | 15:06 |
yvl | if you have the test set up and ready | 15:07 |
yvl | could you try using browser.driver.find_element_by_css(sel) | 15:07 |
replaceafill | ah | 15:07 |
replaceafill | sure | 15:07 |
yvl | (should be identically slow) | 15:07 |
replaceafill | to confirm it's not testing/selenium.py, right? | 15:08 |
yvl | yes | 15:08 |
yvl | I also wonder if replacing row.query_all.tag('td') with jquery script execution speeds up things | 15:09 |
replaceafill | trying: | 15:12 |
replaceafill | ... for row in browser.driver.find_elements_by_css(sel): | 15:12 |
replaceafill | ... tds = row.query_all.tag('td') | 15:12 |
replaceafill | now | 15:12 |
replaceafill | oops | 15:12 |
replaceafill | : | 15:13 |
replaceafill | :| | 15:13 |
replaceafill | AttributeError: 'ChromeWebDriver' object has no attribute 'find_elements_by_css' | 15:13 |
replaceafill | ah | 15:15 |
replaceafill | css_selector | 15:15 |
yvl | right | 15:15 |
replaceafill | ah | 15:16 |
replaceafill | i can't use row.query_all | 15:16 |
replaceafill | after the find_elements call | 15:17 |
replaceafill | because is returning webdriver webelements | 15:17 |
replaceafill | not testing.selenium ones | 15:17 |
replaceafill | (i think) | 15:17 |
replaceafill | AttributeError: 'WebElement' object has no attribute 'query_all' | 15:17 |
yvl | yes | 15:18 |
yvl | you'd need to wrap it into | 15:18 |
yvl | WebElementQuery | 15:19 |
yvl | browser 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 |
yvl | ah | 15:19 |
yvl | browser.query_all._wrap(result) | 15:19 |
replaceafill | :O | 15:20 |
yvl | find_elements_by_css returns plain Selenium objects | 15:20 |
replaceafill | right | 15:21 |
replaceafill | yep, 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 |
replaceafill | for row in browser.driver.find_elements_by_css_selector(sel): | 15:24 |
replaceafill | tds = row.find_elements_by_tag_name('td') | 15:24 |
replaceafill | i'll stick with jquery :D | 15:25 |
yvl | can you do one more test please? | 15:26 |
replaceafill | sure | 15:26 |
yvl | checking if .tag is slower than it's jquery counterpart | 15:26 |
yvl | for row in browser.driver.execute_script('return $(arguments[0])', sel): | 15:27 |
replaceafill | you mean wrapping "row" in my last example above? | 15:27 |
yvl | tds = row.query_all.tag('td') | 15:27 |
replaceafill | but in that case, row doesn't have query_all | 15:28 |
yvl | sorry, yes | 15:28 |
replaceafill | because it's a webdriver webelement | 15:28 |
yvl | tds = brwoser.query_all._wrap(row).query_all.tag('td') | 15:28 |
replaceafill | kk | 15:28 |
yvl | thanks! | 15:28 |
replaceafill | we're all very interested in improving our test times! ;) | 15:29 |
replaceafill | our coverage, not so much :P | 15:29 |
yvl | :DDD | 15:29 |
replaceafill | iep_scr.txt (296.162 s) | 15:38 |
replaceafill | using the _wrap approach | 15:38 |
yvl | so... .tag kills it? | 15:42 |
yvl | how many rows are there? | 15:42 |
replaceafill | hhmm like 14 | 15:44 |
yvl | hmm, we definitely need to at least make some tests with common queries | 15:44 |
yvl | browser.query.css, .tag and others | 15:44 |
replaceafill | what do you mean, we need to *use* those? | 15:45 |
yvl | sorry | 15:45 |
yvl | I meant to test against jquery and see what cases are slow | 15:45 |
replaceafill | ah | 15:45 |
yvl | and if there are cases that are way slower | 15:45 |
replaceafill | i kind of think jquery will beat them all...? | 15:45 |
replaceafill | ah | 15:46 |
replaceafill | you want the "waaaay" part | 15:46 |
yvl | right | 15:46 |
yvl | if it's 10x slower, it's not good | 15:46 |
yvl | reason to hack in something in core | 15:46 |
yvl | like if SOME_CONFIG.QUICK_TEST_HAKK_ENABLED | 15:47 |
yvl | user jquery :) | 15:47 |
replaceafill | :D | 15:47 |
replaceafill | but if browser.driver.find_elements_by_* are equally slow | 15:47 |
replaceafill | i blame webdriver | 15:48 |
replaceafill | not testing.selenium | 15:48 |
replaceafill | in the meantime, is it ok if i (ab)use execute_script + jquery? | 15:49 |
yvl | well... | 15:49 |
yvl | can you hack testing.selenium for now? | 15:49 |
yvl | replace css = proxy_find_element("css_selector") | 15:50 |
yvl | with | 15:50 |
yvl | def css(self, param): | 15:50 |
yvl | return self.execute_script | 15:50 |
replaceafill | ah, you mean, put execute_script + jquery in testing.selenium? | 15:50 |
yvl | yes | 15:51 |
replaceafill | sure | 15:51 |
yvl | oh, and you might want to wrap the results | 15:52 |
yvl | return self._wrap(self.execute_script(...)) | 15:52 |
replaceafill | ah, true | 15:52 |
replaceafill | so we have all the niceties of testing.selenium | 15:53 |
yvl | yes | 15:54 |
yvl | and it would be transparent to all other tests | 15:55 |
replaceafill | should i land that change to trunk? | 15:55 |
replaceafill | or my own branch for later review? | 15:55 |
yvl | either way | 15:55 |
replaceafill | kk | 15:56 |
yvl | but it would be good to have an option not to rely on jquery being there | 15:56 |
replaceafill | i can dare to set up the config option :) | 15:56 |
yvl | :) | 15:56 |
yvl | yes | 15:56 |
yvl | or at least... | 15:56 |
replaceafill | if config option is enabled, use jquery | 15:57 |
yvl | add .use_jquery to Browser | 15:57 |
replaceafill | ah | 15:57 |
replaceafill | easier :D | 15:57 |
yvl | yes :D | 15:58 |
yvl | you can also add a config option | 15:58 |
* yvl won't mind ;) | 15:58 | |
replaceafill | will try! | 15:59 |
replaceafill | thanks yvl, this really helped | 15:59 |
yvl | thanks replaceafill! | 16:01 |
* yvl had no idea selenium was *that* much slower | 16:02 | |
*** pgulley has quit IRC | 16:12 | |
*** paulproteus_ has quit IRC | 17:22 | |
*** paulproteus has joined #schooltool | 17:30 | |
replaceafill | i wonder why "grep -r foobar parts/omelette/schooltool" is not working on 12.10... | 17:35 |
replaceafill | it used to work in 11.10 iirc | 17:36 |
yvl | odd | 17:42 |
yvl | also: I need to upgrade to 12.10 | 17:42 |
yvl | now running 12.04... | 17:42 |
replaceafill | i was blaming omelette, but i think it's not it | 17:42 |
replaceafill | grep works on the vps running 10.04 :/ | 17:43 |
replaceafill | well, i'll use ../ notation ;) | 17:43 |
replaceafill | ah | 17:52 |
replaceafill | https://bugs.launchpad.net/ubuntu/+source/grep/+bug/1049659 | 17:52 |
replaceafill | :) | 17:52 |
replaceafill | grep -R foobar parts/omelette/schooltool | 17:52 |
yvl | oh :) | 17:54 |
*** ignas has joined #schooltool | 18:03 | |
*** replaceafill has quit IRC | 18:19 | |
*** replaceafill has joined #schooltool | 18:28 | |
replaceafill | yvl, i assume you're gone... :) | 18:56 |
ignas | replaceafill, your assumption is correct ;) | 19:09 |
replaceafill | :D | 19:10 |
*** menesis has quit IRC | 19:53 | |
*** ignas has quit IRC | 21:20 | |
*** menesis has joined #schooltool | 21:49 | |
*** menesis has quit IRC | 22:42 | |
*** menesis has joined #schooltool | 22:42 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!