Skip to content

Conversation

@williamma12
Copy link
Contributor

Similar to #236, this pr adds the ability to test the development version cloudpickle against ray.

Fixes #238

@robertnishihara @ogrisel

@codecov
Copy link

codecov bot commented Mar 11, 2019

Codecov Report

Merging #256 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #256   +/-   ##
=======================================
  Coverage   88.05%   88.05%           
=======================================
  Files           1        1           
  Lines         544      544           
  Branches      107      107           
=======================================
  Hits          479      479           
  Misses         42       42           
  Partials       23       23

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 936f16f...5edfb20. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 11, 2019

Codecov Report

Merging #256 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #256   +/-   ##
=======================================
  Coverage   88.05%   88.05%           
=======================================
  Files           1        1           
  Lines         544      544           
  Branches      107      107           
=======================================
  Hits          479      479           
  Misses         42       42           
  Partials       23       23

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 936f16f...78ea88b. Read the comment docs.

Copy link

@robertnishihara robertnishihara left a comment

Choose a reason for hiding this comment

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

Let's start with just one or two really simple tests, e.g., tests/test_mini.py or something like that. Currently this adds too much time to the CI.

Also, I'm not sure if any code in this file is actually shared with the way we do tests for the other thirdparty projects, so I think it may be a lot cleaner to put all of the code in the section for the Ray travis job instead of factoring it out. Do you know what I mean?

    - os: linux
      env: PROJECT=ray TEST_REQUIREMENTS="setproctitle hypothesis psutil flaky networkx tensorflow scipy Cython==0.29"
           PROJECT_URL=https://github.com/ray-project/ray.git
PYTEST_ARGS="--duration=10"

.travis.yml Outdated
pushd ..;
git clone $PROJECT_URL;
pushd ray/examples/cython;
python setup.py install;

Choose a reason for hiding this comment

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

let's avoid building the cython tests for now

@williamma12
Copy link
Contributor Author

Creating separate install and script sections increased readability but did result in some duplicated code. Let me know which is the preferred version! I personally prefer this one with a bit of code duplication for the sake of readability.

Also, I am open to adding more tests than just test_basic.py and test_mini.py @robertnishihara

.travis.yml Outdated
if: commit_message =~ /(\[ci downstream\]|\[ci joblib\])/
- os: linux
env: PROJECT=ray TEST_REQUIREMENTS="setproctitle hypothesis psutil"
PROJECT_URL=https://github.com/ray-project/ray.git

Choose a reason for hiding this comment

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

We can remove PROJECT_URL, right?

.travis.yml Outdated
install:
- pip install .
- pip install --upgrade -r dev-requirements.txt
- pip install tornado

Choose a reason for hiding this comment

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

What istornado for?

Copy link
Contributor Author

@williamma12 williamma12 Mar 13, 2019

Choose a reason for hiding this comment

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

I'm not sure, I was part of the install not specific to any third-party project so I'm assuming it's something that cloudpickle needs for its tests?

cloudpickle/.travis.yml

Lines 86 to 93 in b192238

install:
- pip install .
- pip install --upgrade -r dev-requirements.txt
- pip install tornado
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then
pip install numpy scipy;
fi
- if [[ $PROJECT != "" ]]; then

EDIT: I tried it without the lines in question and it worked

.travis.yml Outdated
- pip install .
- pip install --upgrade -r dev-requirements.txt
- pip install tornado
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then

Choose a reason for hiding this comment

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

I don't think this if statement is necessary.

Choose a reason for hiding this comment

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

We also don't need scipy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see above comment for tornado

@robertnishihara
Copy link

@williamma12 it's starting to look pretty good. By the way, can you test that introducing a bug in cloudpickle caueses this test to fail?

@williamma12
Copy link
Contributor Author

williamma12 commented Mar 16, 2019

@robertnishihara I tested it by adding the following error to cloudpickle and the tests for ray failed

class CloudPickler(Pickler):
dispatch = Pickler.dispatch.copy()
def __init__(self, file, protocol=None):
if protocol is None:
protocol = DEFAULT_PROTOCOL
Pickler.__init__(self, file, protocol=protocol)
# map ids to dictionary. used to ensure that functions can share global env
self.globals_ref = {}
raise ValueError("Test Bug")

@robertnishihara
Copy link

@williamma12 this looks pretty good to me. I left a couple small comments.

@robertnishihara
Copy link

Also, it looks like some of the non-Ray Travis builds are failing. Can you rebase on the current master?

@robertnishihara robertnishihara changed the title MNT: Add ray tests to ci configuration against the development version of cloudpickle Add ray tests to ci configuration against the development version of cloudpickle Mar 18, 2019
Copy link

@robertnishihara robertnishihara left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks @williamma12!

I think this can be merged. @ogrisel want to take a look? Otherwise, I can merge this sometime tomorrow.

Copy link
Contributor

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! I am ok to merge this as is but I would be also open to including more long-running ray tests to ensure better coverage of edge cases.

See also other nitpicks below:

@ogrisel
Copy link
Contributor

ogrisel commented Mar 19, 2019

Thank you very much. I am merging this as this is already a great start. We can always increase the test coverage with other non-flaky test files later.

@ogrisel ogrisel merged commit 810c3f4 into cloudpipe:master Mar 19, 2019
@pierreglaser
Copy link
Member

Thanks a lot @williamma12 @robertnishihara!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants