Skip to content

Add ray tests to ci configuration against the development version of cloudpickle - #256

Merged
ogrisel merged 89 commits into
cloudpipe:masterfrom
williamma12:tests/ray_test
Mar 19, 2019
Merged

Add ray tests to ci configuration against the development version of cloudpickle#256
ogrisel merged 89 commits into
cloudpipe:masterfrom
williamma12:tests/ray_test

Conversation

@williamma12

Copy link
Copy Markdown
Contributor

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

Fixes#238

@robertnishihara@ogrisel

@codecov

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

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

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

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.

@robertnishihararobertnishihara left a comment

Copy link
Copy Markdown

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"

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

Copy link
Copy Markdown

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

Comment thread.travis.yml Outdated
Comment thread.travis.yml Outdated
Comment thread.travis.yml Outdated
Comment thread.travis.yml Outdated
@williamma12

Copy link
Copy Markdown
ContributorAuthor

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

Comment thread.travis.yml Outdated
Comment thread.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

Copy link
Copy Markdown

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?

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What istornado for?

@williamma12williamma12Mar 13, 2019

Copy link
Copy Markdown
ContributorAuthor

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?

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

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

Copy link
Copy Markdown

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.

Copy link
Copy Markdown

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
Copy Markdown
ContributorAuthor

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

Comment thread.travis.yml Outdated
Comment thread.travis.yml Outdated
Comment thread.travis.yml Outdated
Comment thread.travis.yml Outdated
Comment thread.travis.yml Outdated
@robertnishihara

Copy link
Copy Markdown

@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

williamma12 commented Mar 16, 2019

Copy link
Copy Markdown
ContributorAuthor

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

classCloudPickler(Pickler):
dispatch=Pickler.dispatch.copy()
def__init__(self, file, protocol=None):
ifprotocolisNone:
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= {}
raiseValueError("Test Bug")

Comment thread.travis.yml Outdated
Comment thread.travis.yml
Comment thread.travis.yml
@robertnishihara

Copy link
Copy Markdown

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

@robertnishihara

Copy link
Copy Markdown

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

@robertnishihararobertnishihara changed the title MNT: Add ray tests to ci configuration against the development version of cloudpickleAdd ray tests to ci configuration against the development version of cloudpickleMar 18, 2019

@robertnishihararobertnishihara left a comment

Copy link
Copy Markdown

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.

@ogriselogrisel left a comment

Copy link
Copy Markdown
Contributor

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:

Comment thread.travis.yml Outdated
Comment thread.travis.yml Outdated
Comment thread.travis.yml Outdated
@ogrisel

Copy link
Copy Markdown
Contributor

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:masterMar 19, 2019
@pierreglaser

Copy link
Copy Markdown
Member

Thanks a lot @williamma12@robertnishihara!

Sign up for freeto 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

@williamma12@robertnishihara@ogrisel@pierreglaser