[Testing] Do not run any non-RLlib/core tests if only RLLib affected (except wheels). (#7892)

* Do not run any non-RLlib/core tests if only RLLib affected, except for generating the 2 wheels (OSX and Linux).

* Test noop RLlib change.

* Test noop RLlib change.

* Fix broken RLlib tests in master.

* Split BAZEL learning tests into cartpole and pendulum (reached the 60min barrier).

* Fix error_outputs option in BAZEL for RLlib regression tests.

* Fix.

* Test.

* WIP.

* Add env flag RAY_CI_ONLY_RLLIB_AFFECTED to refrain from testing most ray-core stuff (except wheels) if only RLlib changed.

* Test RLlib-only change.
This commit is contained in:
Sven Mika
2020-04-09 14:36:06 -07:00
committed by GitHub
parent 1b31c11806
commit 0a5b6d1f57
3 changed files with 20 additions and 5 deletions
+7 -2
View File
@@ -56,6 +56,7 @@ matrix:
- RAY_GCS_SERVICE_ENABLED=false
install:
- eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py`
- if [ $RAY_CI_ONLY_RLLIB_AFFECTED == "1" ]; then exit; fi
- ./ci/travis/install-bazel.sh
- ./ci/suppress_output ./ci/travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
@@ -63,6 +64,7 @@ matrix:
- ./ci/suppress_output ./ci/travis/install-cython-examples.sh
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=master bash)"
script:
- if [ $RAY_CI_ONLY_RLLIB_AFFECTED == "1" ]; then exit; fi
- ./ci/suppress_output bash src/ray/test/run_core_worker_tests.sh
- ./ci/suppress_output bash streaming/src/test/run_streaming_queue_test.sh
- ./java/test.sh
@@ -76,6 +78,7 @@ matrix:
- RAY_GCS_SERVICE_ENABLED=false
install:
- eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py`
- if [ $RAY_CI_ONLY_RLLIB_AFFECTED == "1" ]; then exit; fi
- ./ci/travis/install-bazel.sh
- ./ci/suppress_output ./ci/travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
@@ -83,6 +86,7 @@ matrix:
- ./ci/suppress_output ./ci/travis/install-cython-examples.sh
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=master bash)"
script:
- if [ $RAY_CI_ONLY_RLLIB_AFFECTED == "1" ]; then exit; fi
- export PATH="$HOME/miniconda/bin:$PATH"
- ./ci/keep_alive bazel test --spawn_strategy=local --flaky_test_attempts=3 --nocache_test_results --test_verbose_timeout_warnings --progress_report_interval=100 --show_progress_rate_limit=100 --show_timestamps --test_output=errors --test_tag_filters=-jenkins_only python/ray/tests/...
@@ -152,7 +156,6 @@ matrix:
script:
- if [ $RAY_CI_LINUX_WHEELS_AFFECTED != "1" ]; then exit; fi
# Explicitly sleep 60 seconds for logs to go through
- ./ci/travis/test-wheels.sh || { cat /tmp/ray/session_latest/logs/* && sleep 60 && false; }
cache: false
@@ -318,7 +321,7 @@ matrix:
install:
- eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py`
- if [ $RAY_CI_SERVE_AFFECTED != "1" ] && [ $RAY_CI_TUNE_AFFECTED != "1" ] && [ $RAY_CI_RLLIB_AFFECTED != "1" ] && [ $RAY_CI_PYTHON_AFFECTED != "1" ]; then exit; fi
- if [ $RAY_CI_SERVE_AFFECTED != "1" ] && [ $RAY_CI_TUNE_AFFECTED != "1" ] && [ $RAY_CI_PYTHON_AFFECTED != "1" ]; then exit; fi
- ./ci/travis/install-bazel.sh
- ./ci/suppress_output ./ci/travis/install-dependencies.sh
@@ -329,6 +332,8 @@ install:
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=master bash)"
script:
- if [ $RAY_CI_SERVE_AFFECTED != "1" ] && [ $RAY_CI_TUNE_AFFECTED != "1" ] && [ $RAY_CI_PYTHON_AFFECTED != "1" ]; then exit; fi
- export PATH="$HOME/miniconda/bin:$PATH"
# raylet integration tests
+12 -2
View File
@@ -33,8 +33,9 @@ def list_changed_files(commit_range):
if __name__ == "__main__":
RAY_CI_TUNE_AFFECTED = 0
RAY_CI_RLLIB_AFFECTED = 0
RAY_CI_RLLIB_FULL_AFFECTED = 0
RAY_CI_ONLY_RLLIB_AFFECTED = 0 # Whether only RLlib is affected.
RAY_CI_RLLIB_AFFECTED = 0 # Whether RLlib minimal tests should be run.
RAY_CI_RLLIB_FULL_AFFECTED = 0 # Whether full RLlib tests should be run.
RAY_CI_SERVE_AFFECTED = 0
RAY_CI_JAVA_AFFECTED = 0
RAY_CI_PYTHON_AFFECTED = 0
@@ -129,10 +130,19 @@ if __name__ == "__main__":
RAY_CI_STREAMING_PYTHON_AFFECTED = 1
RAY_CI_STREAMING_JAVA_AFFECTED = 1
if not RAY_CI_TUNE_AFFECTED and not RAY_CI_SERVE_AFFECTED and \
not RAY_CI_JAVA_AFFECTED and not RAY_CI_PYTHON_AFFECTED and not \
RAY_CI_STREAMING_CPP_AFFECTED and \
not RAY_CI_STREAMING_PYTHON_AFFECTED and \
not RAY_CI_STREAMING_JAVA_AFFECTED:
RAY_CI_ONLY_RLLIB_AFFECTED = 1
# Log the modified environment variables visible in console.
for output_stream in [sys.stdout, sys.stderr]:
_print = partial(print, file=output_stream)
_print("export RAY_CI_TUNE_AFFECTED={}".format(RAY_CI_TUNE_AFFECTED))
_print("export RAY_CI_ONLY_RLLIB_AFFECTED={}"
.format(RAY_CI_ONLY_RLLIB_AFFECTED))
_print("export RAY_CI_RLLIB_AFFECTED={}".format(RAY_CI_RLLIB_AFFECTED))
_print("export RAY_CI_RLLIB_FULL_AFFECTED={}".format(
RAY_CI_RLLIB_FULL_AFFECTED))
+1 -1
View File
@@ -158,7 +158,7 @@ def chop_into_sequences(episode_ids,
_extra_padding=0):
"""Truncate and pad experiences into fixed-length sequences.
Arguments:
Args:
episode_ids (list): List of episode ids for each step.
unroll_ids (list): List of identifiers for the sample batch. This is
used to make sure sequences are cut between sample batches.