From 6e311b4d4799bcb14b3d2e23f52a358a18ce87e8 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Wed, 13 Feb 2019 15:56:47 +0000 Subject: [PATCH] Fixes installation nightly test by filtering out the git commands --- tests/jenkins/run_test_installation_docs.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/jenkins/run_test_installation_docs.sh b/tests/jenkins/run_test_installation_docs.sh index d25f1d500c8f..832c45cad2f0 100755 --- a/tests/jenkins/run_test_installation_docs.sh +++ b/tests/jenkins/run_test_installation_docs.sh @@ -250,6 +250,20 @@ function set_instruction_set() { ${sorted_indexes[$end_buildfromsource_command_index]}) } +# given a build commands string, filter any build commands that ought not be executed +# during the test. An example would be git clone'ing the mxnet repository. You want to +# run the tests against the current commit being tested in Jenkins. +function filter_build_commands() { + filtered_build_commands="${1}" + + # Remove git commands + filtered_build_commands=`echo "${filtered_build_commands}" | perl -pe 's/git .*?;//g'` + + # Remove 'cd incubator-mxnet' + filtered_build_commands=`echo "${filtered_build_commands}" | perl -pe 's/cd incubator-mxnet;//'` + + echo "${filtered_build_commands}" +} ########################LINUX-PYTHON-CPU############################ echo @@ -302,8 +316,8 @@ ubuntu_python_cpu_source() set -e echo echo "### Testing Build From Source ###" - echo "${buildfromsource_commands}" - echo + buildfromsource_commands=$(filter_build_commands "${buildfromsource_commands}") + echo ${buildfromsource_commands} eval ${buildfromsource_commands} echo "ubuntu_python_cpu_source: MXNet Installed Successfully" @@ -364,7 +378,8 @@ ubuntu_python_gpu_source() echo echo "### Testing Build From Source ###" echo "${buildfromsource_commands}" - echo + buildfromsource_commands=$(filter_build_commands "${buildfromsource_commands}") + echo ${buildfromsource_commands} eval ${buildfromsource_commands} echo "ubuntu_python_gpu_source: MXNet Installed Successfully"