diff options
author | zsxwing <zsxwing@gmail.com> | 2015-07-30 00:46:36 -0700 |
---|---|---|
committer | Tathagata Das <tathagata.das1565@gmail.com> | 2015-07-30 00:46:36 -0700 |
commit | 76f2e393a5fad0db8b56c4b8dad5ef686bf140a4 (patch) | |
tree | 130545e84ef33ea4e7a6c720ff8798b11565d889 /dev/run-tests.py | |
parent | 1221849f91739454b8e495889cba7498ba8beea7 (diff) | |
download | spark-76f2e393a5fad0db8b56c4b8dad5ef686bf140a4.tar.gz spark-76f2e393a5fad0db8b56c4b8dad5ef686bf140a4.tar.bz2 spark-76f2e393a5fad0db8b56c4b8dad5ef686bf140a4.zip |
[SPARK-9335] [TESTS] Enable Kinesis tests only when files in extras/kinesis-asl are changed
Author: zsxwing <zsxwing@gmail.com>
Closes #7711 from zsxwing/SPARK-9335-test and squashes the following commits:
c13ec2f [zsxwing] environs -> environ
69c2865 [zsxwing] Merge remote-tracking branch 'origin/master' into SPARK-9335-test
ef84a08 [zsxwing] Revert "Modify the Kinesis project to trigger ENABLE_KINESIS_TESTS"
f691028 [zsxwing] Modify the Kinesis project to trigger ENABLE_KINESIS_TESTS
7618205 [zsxwing] Enable Kinesis tests only when files in extras/kinesis-asl are changed
Diffstat (limited to 'dev/run-tests.py')
-rwxr-xr-x | dev/run-tests.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/dev/run-tests.py b/dev/run-tests.py index 1f0d218514..29420da9aa 100755 --- a/dev/run-tests.py +++ b/dev/run-tests.py @@ -85,6 +85,13 @@ def identify_changed_files_from_git_commits(patch_sha, target_branch=None, targe return [f for f in raw_output.split('\n') if f] +def setup_test_environ(environ): + print("[info] Setup the following environment variables for tests: ") + for (k, v) in environ.items(): + print("%s=%s" % (k, v)) + os.environ[k] = v + + def determine_modules_to_test(changed_modules): """ Given a set of modules that have changed, compute the transitive closure of those modules' @@ -455,6 +462,15 @@ def main(): print("[info] Found the following changed modules:", ", ".join(x.name for x in changed_modules)) + # setup environment variables + # note - the 'root' module doesn't collect environment variables for all modules. Because the + # environment variables should not be set if a module is not changed, even if running the 'root' + # module. So here we should use changed_modules rather than test_modules. + test_environ = {} + for m in changed_modules: + test_environ.update(m.environ) + setup_test_environ(test_environ) + test_modules = determine_modules_to_test(changed_modules) # license checks |