From 8b4cb89149859d97b7af7d1dff1d7660f1b4e868 Mon Sep 17 00:00:00 2001 From: Pavel Sountsov Date: Wed, 16 Jan 2019 10:19:46 -0800 Subject: [PATCH 1/6] Revert --quiet --- testing/oss_lints.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/oss_lints.sh b/testing/oss_lints.sh index 364bb9ca0c..60299ecef3 100755 --- a/testing/oss_lints.sh +++ b/testing/oss_lints.sh @@ -32,7 +32,7 @@ get_changed_py_files() { git diff \ --name-only \ --diff-filter=AM ${TRAVIS_BRANCH}...HEAD \ - | grep --quiet '^tensorflow_probability.*\.py$' + | grep '^tensorflow_probability.*\.py$' || true } # Run lints on added/changed python files. From da510b0ef8d5b8628b2dc87481bca3b6b681bc60 Mon Sep 17 00:00:00 2001 From: Pavel Sountsov Date: Wed, 16 Jan 2019 10:28:37 -0800 Subject: [PATCH 2/6] Typo --- testing/oss_lints.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/oss_lints.sh b/testing/oss_lints.sh index 60299ecef3..aeb493132b 100755 --- a/testing/oss_lints.sh +++ b/testing/oss_lints.sh @@ -39,7 +39,7 @@ get_changed_py_files() { changed_py_files=$(get_changed_py_files) if [[ -n "${changed_py_files}" ]]; then echo "Running pylint on ${changed_py_files}" - pylint -j2 --rcfile=testing/pylintrc ${changed_py_files}) + pylint -j2 --rcfile=testing/pylintrc ${changed_py_files} else echo "No files to lint." fi From d0ae477a75b8a4c34c91edd2113090ab24185381 Mon Sep 17 00:00:00 2001 From: Pavel Sountsov Date: Wed, 16 Jan 2019 10:53:49 -0800 Subject: [PATCH 3/6] Trigger lint, disable upgraded numpy --- tensorflow_probability/python/mcmc/hmc.py | 2 +- tensorflow_probability/python/mcmc/hmc_test.py | 1 + testing/oss_install.sh | 2 +- testing/oss_tests.sh | 5 ++++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tensorflow_probability/python/mcmc/hmc.py b/tensorflow_probability/python/mcmc/hmc.py index be18bd614b..0de152454b 100644 --- a/tensorflow_probability/python/mcmc/hmc.py +++ b/tensorflow_probability/python/mcmc/hmc.py @@ -134,7 +134,7 @@ def step_size_simple_update_fn(step_size_var, kernel_results): tf.log(target_rate), log_mean_accept_ratio.dtype), -decrement_multiplier / (1. + decrement_multiplier), increment_multiplier) - + a = True def build_assign_op(): if mcmc_util.is_list_like(step_size_var): return [ diff --git a/tensorflow_probability/python/mcmc/hmc_test.py b/tensorflow_probability/python/mcmc/hmc_test.py index d1eba9ef8e..61dfc57c55 100644 --- a/tensorflow_probability/python/mcmc/hmc_test.py +++ b/tensorflow_probability/python/mcmc/hmc_test.py @@ -40,6 +40,7 @@ def run_in_graph_mode_only(__unused__=None, config=None, use_gpu=True): # pylint: disable=invalid-name,unused-argument """Execute the decorated test in graph mode only.""" assert not __unused__, 'Add () after run_in_graph_mode_only.' + b = False def decorator(f): def decorated(self, **kwargs): with context.graph_mode(): diff --git a/testing/oss_install.sh b/testing/oss_install.sh index 0cc5fab6ba..c5e6669f14 100755 --- a/testing/oss_install.sh +++ b/testing/oss_install.sh @@ -33,7 +33,7 @@ pip install scipy hypothesis matplotlib pylint # Upgrade numpy to the latest to address issues that happen when testing with # Python 3. -pip install -U numpy +# pip install -U numpy # Install Bazel for tests. # Step 1: Install the JDK diff --git a/testing/oss_tests.sh b/testing/oss_tests.sh index c3df3591dd..e7f7c1efe1 100755 --- a/testing/oss_tests.sh +++ b/testing/oss_tests.sh @@ -40,8 +40,11 @@ shard_tests=$(bazel query 'tests(//tensorflow_probability/...)' | # (short, moderate, long or eternal) # --test_tag_filters -- skip tests whose 'tags' arg (if present) includes any # of the comma-separated entries +# --action_env -- specify environment vars to pass through to action +# environment. (We need these in order to run inside a virtualenv.) +# See https://github.com/bazelbuild/bazel/issues/6648 and b/121259040. echo "${shard_tests}" | xargs bazel test --copt=-O3 --copt=-march=native \ - --noincompatible_strict_action_env \ --test_tag_filters=-gpu,-requires-gpu-sm35 \ --test_timeout 300,450,1200,3600 --build_tests_only \ + --action_env=PATH --action_env=LD_LIBRARY_PATH \ --test_output=errors From f47d46f792d50e17409830767a13cb96f625763b Mon Sep 17 00:00:00 2001 From: Pavel Sountsov Date: Wed, 16 Jan 2019 11:30:17 -0800 Subject: [PATCH 4/6] Fix lint code --- testing/oss_install.sh | 2 +- testing/oss_lints.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/testing/oss_install.sh b/testing/oss_install.sh index c5e6669f14..0cc5fab6ba 100755 --- a/testing/oss_install.sh +++ b/testing/oss_install.sh @@ -33,7 +33,7 @@ pip install scipy hypothesis matplotlib pylint # Upgrade numpy to the latest to address issues that happen when testing with # Python 3. -# pip install -U numpy +pip install -U numpy # Install Bazel for tests. # Step 1: Install the JDK diff --git a/testing/oss_lints.sh b/testing/oss_lints.sh index aeb493132b..38ee408839 100755 --- a/testing/oss_lints.sh +++ b/testing/oss_lints.sh @@ -28,10 +28,9 @@ if [[ ${SHARD} != 0 ]]; then fi get_changed_py_files() { - # grep --quiet forces exit status 0 even if no matches are found git diff \ --name-only \ - --diff-filter=AM ${TRAVIS_BRANCH}...HEAD \ + --diff-filter=AM origin/${TRAVIS_BRANCH}...HEAD \ | grep '^tensorflow_probability.*\.py$' || true } From 555c3951bb6def736df5d2fdf6d01022e8ff2109 Mon Sep 17 00:00:00 2001 From: Pavel Sountsov Date: Wed, 16 Jan 2019 11:46:13 -0800 Subject: [PATCH 5/6] Try again --- testing/oss_lints.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/oss_lints.sh b/testing/oss_lints.sh index 38ee408839..cf110bddff 100755 --- a/testing/oss_lints.sh +++ b/testing/oss_lints.sh @@ -28,6 +28,7 @@ if [[ ${SHARD} != 0 ]]; then fi get_changed_py_files() { + git fetch --depth=20 --quiet origin ${TRAVIS_BRANCH} git diff \ --name-only \ --diff-filter=AM origin/${TRAVIS_BRANCH}...HEAD \ From aa8e77ea4a8046bae714729573c7884784e65b4b Mon Sep 17 00:00:00 2001 From: Pavel Sountsov Date: Wed, 16 Jan 2019 12:00:57 -0800 Subject: [PATCH 6/6] One last time --- testing/oss_lints.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/oss_lints.sh b/testing/oss_lints.sh index cf110bddff..afc9dc9512 100755 --- a/testing/oss_lints.sh +++ b/testing/oss_lints.sh @@ -28,7 +28,9 @@ if [[ ${SHARD} != 0 ]]; then fi get_changed_py_files() { - git fetch --depth=20 --quiet origin ${TRAVIS_BRANCH} + # Need to fetch the base branch in case it is not master. + git remote set-branches --add origin ${TRAVIS_BRANCH} + git fetch --depth=20 --quiet git diff \ --name-only \ --diff-filter=AM origin/${TRAVIS_BRANCH}...HEAD \