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

Clean up Test Support #8078

Merged
merged 18 commits into from Jul 13, 2018

Conversation

Projects
None yet
1 participant
@bryevdv
Copy link
Member

bryevdv commented Jul 12, 2018

The situation under /tests was a huge mess. The directory had dead code, duplicated code, lacked organization (no less than three "util" modules), and contained some broken/mistaken things. This PR cleans things up considerably:

  • moves all testing support including utils, pytest plugins, etc to bokeh._testing. This includes removing bokeh.util.testing
  • flattens the top level "tests" dir to only contain tests and not test support
  • removes dead and disused code, "cross_browser", etc.
  • split various "util" modules into meaningful submodules under bokeh._testing.util
  • moved color/term functions to bokeh.util.terminal
  • added a "pandas" plugin so that unweildy fixture imports could be removed throughout
  • consolidated to a single top-level conftest.py with minimal plugins (test files require more specific plugins as needed)

I left the currently broken integration test code, which is now probably more broken. After this is merged I will rebuild selenium tests from the ground up (possibly removing several pytest dependencies)

Some of the remaining code is also still currently unused, I will use it or dispose of it in the follow on selenium PR.

Here is bokeh.testing after the PR:

bokeh/_testing
├── __init__.py
├── plugins
│   ├── __init__.py
│   ├── bokeh_server.py
│   ├── examples_report.jinja
│   ├── examples_report.py
│   ├── file_server.py
│   ├── implicit_mark.py
│   ├── integration_tests.py
│   ├── jupyter_notebook.py
│   ├── log_file.py
│   └── pandas.py
└── util
    ├── __init__.py
    ├── api.py
    ├── chrome_screenshot.js
    ├── examples.py
    ├── filesystem.py
    ├── git.py
    ├── images.py
    ├── s3.py
    ├── screenshot.py
    ├── selenium.py
    └── travis.py

@bryevdv bryevdv added the status: WIP label Jul 12, 2018

@bryevdv

This comment has been minimized.

Copy link
Member Author

bryevdv commented Jul 12, 2018

One thing I don't like: at least for now, all extra pytest cmd line opts are added in the top-level conftest.py if I can find a way to improve this, I will.

@bryevdv

This comment has been minimized.

Copy link
Member Author

bryevdv commented Jul 12, 2018

Here is /tests after the PR, will clean up integration in follow in work:

tests
├── __init__.py
├── integration
│   ├── README.md
│   ├── __init__.py
│   └── interaction
│       ├── __init__.py
│       ├── screenshots
│       │   ├── base__test_datatable__test_data_table_selected_highlighting.png
│       │   ├── base__test_hover__test_hover_changes_color.png
│       │   └── base__test_selection__test_line_rendering_with_selected_points.png
│       ├── test_datatable.py
│       ├── test_hover.py
│       ├── test_pan_tool.py
│       ├── test_patches_preselection.py
│       ├── test_range_min_max.py
│       ├── test_reset_tool.py
│       ├── test_selection.py
│       ├── test_sizing_mode.py
│       ├── test_tap.py
│       ├── test_tools.py
│       └── test_wheel_zoom.py
├── test_bokehjs.py
├── test_code_quality.py
├── test_examples.py
├── test_flake8.py
├── test_no_client_server_common.py
├── test_no_ipython_common.py
├── test_no_request_host.py
├── test_no_tornado_common.py
├── test_python_execution_with_OO.py
└── test_windows_reserved_filenames.py
@bryevdv

This comment has been minimized.

Copy link
Member Author

bryevdv commented Jul 12, 2018

@mattpap it just occurred to me that perhaps bokeh._testing would be more appropriate, ~~~do you have any preference?~~~

I've going ahead and done this, it is easier to grep for in code and makes it clear that nothing there is to be considered user code.

@bryevdv

This comment has been minimized.

Copy link
Member Author

bryevdv commented Jul 12, 2018

@mattpap I will plan to merge this tomorrow unless you have comments.

@bryevdv bryevdv added this to the 1.0 milestone Jul 12, 2018

@bryevdv bryevdv merged commit 4a68572 into master Jul 13, 2018

2 checks passed

Better Code Hub ✅ Better Code Hub approves this code
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@bryevdv bryevdv deleted the bryanv/testing branch Jul 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment