Skip to content

Conversation

@williamma12
Copy link
Contributor

What do these changes do?

Moves relevant python tests to python/ray/test/ so that it will ship with ray when installed from Pypi.

Related issue number

@williamma12
Copy link
Contributor Author

Using this comment to start a discussion on the motivations behind why certain tests were moved and others were not

Moved:

  • actor_test.py: mainly just tests that the python api passes the arguments and other common class functionality to ray properly
  • array_test.py: Tests ray.experimental.array functions work as expected
  • cython_test.py: Tests that cython works as expected with ray
  • failure_test.py: Tests that ray propagates errors correctly
  • mini_test.py: Tests basic ray python api calls
  • recursion_test.py: Tests recursive python functions work as expected
  • runtest.py: Tests various ray’s python api functionality
  • tensorflow_test.py Tests that tensorflow works as expected

Not Moved:

  • autoscaler.py: Small stress test
  • component_failures_test.py:Fault tolerance testing for each of the different parts of ray
  • credits_test.py: Tests redis
  • debug_tools_test.py: Tests that the debug tools still work
  • microbenchmarks.py: Benchmarking
  • jenkins_tests/: Stress tests
  • monitor_test.py: Tests that the monitor returns the expected values
  • multi_node_test.py: Tests that the nodes behave as expected
  • multi_node_test_2.py: More tests that tests that nodes behave as expected
  • node_manager_test.py: Tests the node manager works for edge cases
  • object_manager_test.py: Tests that the object manager works as expected
  • stress_tests/ and stress_tests.py: Stress tests
  • tempfile_test.py: Tests that the temporary files are created properly

@robertnishihara
Copy link
Collaborator

Looks like it should be tests not test. See https://python-packaging.readthedocs.io/en/latest/testing.html.

@robertnishihara
Copy link
Collaborator

Thanks @williamma12! I think we should actually move all of the tests except stress_tests/* and jenkins_tests/.

@robertnishihara
Copy link
Collaborator

@pcmoritz what do you think?

@pcmoritz
Copy link
Contributor

pcmoritz commented Feb 5, 2019

I agree and we can also rename the "test" directory in the root to "ci" or "integration" something else so it is clear that tests should not go there, but into the new folder instead.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11568/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11607/
Test FAILed.

@williamma12
Copy link
Contributor Author

williamma12 commented Feb 6, 2019

Sounds good! I've moved all the files from the old test/ to python/ray/test except for stress_tests/, jenkins_tests/ , and microbenchmarking.py. microbenchmarking.py was not moved because it does not actually contain any pytest tests but just benchmarks that prints the benchmarks. I was mistaken, microbenchmarking.py does have pytest tests

I have also updated the folder names from test/ and python/ray/test/ to integration/ and python/ray/tests, respectively.

Also, I am open to suggestions for better names for the new integration/ folder!

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11609/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11618/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11622/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11633/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11634/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11658/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11661/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11671/
Test FAILed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

rename to utils

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11708/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11711/
Test FAILed.

@williamma12 williamma12 force-pushed the refactor/move_python_tests branch from 7511514 to 870d4e1 Compare February 10, 2019 22:11
@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11744/
Test FAILed.

.travis.yml Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I think now it's a good chance to follow the test discovery convention (see https://docs.pytest.org/en/latest/goodpractices.html#conventions-for-python-test-discovery) and change these file-based commands to to one single directory-based command (or a few sub-directories if needed).
The benefit is that we can only have one statement in this travis ci file, e.g., pytest -v --duration=10 python/ray/tests. And when someone adds a new test file, they don't need to modify here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Doing so also revealed that the test_queue.py lacked a teardown_module, which I added in #4012.

I notice that there was also a comment about object_manager_test.py and I left it as a separate command but I am open to suggestions

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11762/
Test FAILed.

.travis.yml Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will run test_object_manager.py twice, right? Maybe we can move the above comment to the test_object_manager.py file, and don't need to make this a separate command. cc @guoyuhong

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reworded the comment so that I could keep the comment in .travis.yml and delete the line so test_object_manager.py won't be ran twice

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11917/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/11927/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12055/
Test FAILed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@williamma12 does this test actually work in pytest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops good catch. Did not intend to move the remote function inside the test and undoing it made the test pass.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For consistency, can you rename init to ray_start?

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12057/
Test FAILed.

@williamma12 williamma12 force-pushed the refactor/move_python_tests branch from 8317566 to 9da8220 Compare February 18, 2019 00:22
@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12058/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12060/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12069/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12070/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12098/
Test FAILed.

@williamma12 williamma12 force-pushed the refactor/move_python_tests branch from 714c73c to 60b8b87 Compare February 19, 2019 03:58
@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12116/
Test FAILed.

@williamma12 williamma12 force-pushed the refactor/move_python_tests branch from 60b8b87 to df6e0f2 Compare February 20, 2019 02:00
@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12138/
Test FAILed.

@robertnishihara
Copy link
Collaborator

There seems to be an issue with test_monitor.py.

@williamma12 williamma12 force-pushed the refactor/move_python_tests branch from df6e0f2 to 4f0c5d6 Compare February 20, 2019 21:05
@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12164/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12170/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12174/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12177/
Test FAILed.

@robertnishihara robertnishihara force-pushed the refactor/move_python_tests branch from 3a4483d to 4581216 Compare February 21, 2019 07:57
@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12194/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12195/
Test FAILed.

Copy link
Collaborator

@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.

LGTM once tests pass.

@robertnishihara robertnishihara force-pushed the refactor/move_python_tests branch from 81f759a to 1127d6b Compare February 21, 2019 08:14
@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Ray-PRB/12196/
Test FAILed.

@robertnishihara robertnishihara changed the title Moving tests from test/ to python/ray/test/ Moving tests from test/ to python/ray/tests/ Feb 21, 2019
@robertnishihara robertnishihara merged commit c7a4c74 into ray-project:master Feb 21, 2019
@robertnishihara
Copy link
Collaborator

Jenkins, retest this please.

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.

5 participants