Skip to content

Commit

Permalink
Fixes installation nightly test by filtering out the git commands (ap…
Browse files Browse the repository at this point in the history
  • Loading branch information
perdasilva authored and drivanov committed Mar 4, 2019
1 parent 7d63b57 commit a0db0f6
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions tests/jenkins/run_test_installation_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,29 @@ function set_instruction_set() {
${sorted_indexes[$end_buildfromsource_command_index]})
}

# given a $buildfromsource_commands string, filter out any build commands that should not be executed
# during the build from source tests. An example, the build from source instructions include the commands:
# $ git clone --recursive https://github.com/apache/incubator-mxnet
# $ cd incubator-mxnet
# if these commands get executed in the jenkins job, we will be testing the build from source instructions
# against the master branch and not against the version of the repository that Jenkins checksout for testing.
# This presents a particularly big problem for the version branches and their nightly builds. Because,
# we would, in effect, be testing the build from source instructions for one version of MXNet against
# the master branch.
# in this function we target the commands cited in the example above, but leave it open for expantion
# in the future.
# See also gh issue: https://github.com/apache/incubator-mxnet/issues/13800
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
Expand Down Expand Up @@ -302,8 +325,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"

Expand Down Expand Up @@ -363,8 +386,8 @@ ubuntu_python_gpu_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_gpu_source: MXNet Installed Successfully"

Expand Down

0 comments on commit a0db0f6

Please sign in to comment.