Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration tests #5961

Merged
merged 14 commits into from Mar 10, 2017
Merged

Fix integration tests #5961

merged 14 commits into from Mar 10, 2017

Conversation

canavandl
Copy link
Contributor

@canavandl canavandl commented Mar 6, 2017

@canavandl canavandl changed the title dummy PR for diagnosing saucelabs issues Fix integration tests Mar 7, 2017
self._check_func_called(mock_standalone_html_page,
(obj, resources, title),
{})
self._check_func_called(mock_io_open,
Copy link
Contributor Author

@canavandl canavandl Mar 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the test is "not great". It'd be better to have io.open generate a tempfile then check the content after writing to it, but I couldn't get that to work.

@@ -442,10 +442,10 @@ def _get_save_args(state, filename, resources, title):
def _save_helper(obj, filename, resources, title, validate):
remove_after = False
if isinstance(obj, LayoutDOM):
doc = obj.document
if doc is None:
doc = Document().add_root(obj)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem was here, in that Document.add_root doesn't return a value. So trying the call validate on the None value was raising an exception and killing the integration tests.

@mattpap
Copy link
Contributor

mattpap commented Mar 8, 2017

@canavandl, can you also improve integration tests, so that we get an actual exception and not some internal errors, which give no indication of really happened. Because next time I see those internal errors, I will just do git rm on this.

@canavandl
Copy link
Contributor Author

I think I've figured out a route to do that (bubble the test exceptions up to the user report). I'll re-mark this PR as WIP and try to implement.

@mattpap
Copy link
Contributor

mattpap commented Mar 8, 2017

@canavandl, OK, thanks.

report = outcome.get_result()
xfail = hasattr(report, 'wasxfail')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this currently no-op? I removed it but could add the logic back.

@canavandl
Copy link
Contributor Author

I'm currently unable to locally reproduce the test failures (integration tests related to panning in the x-dimension). ping @bryevdv to see if you can diagnose.

@canavandl
Copy link
Contributor Author

Overall, this causes exceptions to bubble up to the user. The html report generation continues to be the same.

New pytest log output for tests failing due to non-screenshot-related exceptions:

screen shot 2017-03-08 at 4 39 14 pm

New pytest log output for tests failing due to screenshot mismatch (you'll see on of the arrows are commented out, causing the mismatch):

screen shot 2017-03-08 at 4 39 33 pm

@mattpap
Copy link
Contributor

mattpap commented Mar 9, 2017

I'm currently unable to locally reproduce the test failures (integration tests related to panning in the x-dimension).

This is likely related to PR #5349. I will be investigating, though I'm never sure how to do this with integration tests. I would prefer to have those written in JS (plotting + interactions), so that I could run this directly in a browser and observe results.

save(plot)
selenium.get(output_file_url)
assert has_no_console_errors(selenium)

# Pan plot and test for new range value
pan_plot(selenium, pan_x=200, pan_y=0)
new_range_start = float(selenium.execute_script("""alert(window.get_x_range_start())"""))
pan_plot(selenium, pan_x=150, pan_y=0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change pan range? Does if fail otherwise? This change doesn't seem related to other changes here, so it does in fact fail, maybe there is something more going on underneath.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests fail without the change. One issue was that the pan end was outside of the plot frame, so that the pan event didn't happen.

I'm not 100% sure why this wasn't a problem earlier.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this change with this explanation and @canavandl reports on local changes. any objection to merging @mattpap ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable, though it looks like there may be some effect of PR #5349. As long as panning works we are fine, but I will have closer look at what happens at the boundaries.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, merging now then.

@canavandl
Copy link
Contributor Author

To reiterate, it's now possible to run the non-screenshot integration tests locally and use the --pdb flag as expected (which was helpful in debugging this).

It's also possible to generate the screenshot report locally via the SauceLab Connect proxy, setting the --driver=SauceLabs and --html=report.html (or any html filename and location)

@mattpap
Copy link
Contributor

mattpap commented Mar 10, 2017

LGTM

@bryevdv bryevdv merged commit 920d39a into master Mar 10, 2017
@bryevdv bryevdv deleted the canavandl/integration_tests branch March 10, 2017 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-enable Saucelabs tests
3 participants