CLI code coverage: install python requirements as root instead of as gpadmin
This makes it easier to maintain this part of the script, now that we no
longer need the virtualenv to be active while running the tests.
@@ -19,14 +19,11 @@ function install_python_hacks() {
fi
}
-function gen_env(){
- cat > /opt/run_test.sh <<-EOF
- set -ex
-
+function install_python_requirements() {
# virtualenv 16.0 and greater does not support python2.6, which is
# used on centos6
pip install --user virtualenv~=15.0
- export PATH=\$PATH:~/.local/bin
+ export PATH=$PATH:~/.local/bin
# create virtualenv before sourcing greenplum_path since greenplum_path
# modifies PYTHONHOME and PYTHONPATH
@@ -57,9 +54,14 @@ function gen_env(){
# Install requirements into the vendored Python stack.
mkdir -p /tmp/py-requirements
source /tmp/venv/bin/activate
- pip install --prefix /tmp/py-requirements -r "\${1}/gpdb_src/gpMgmt/requirements-dev.txt"
+ pip install --prefix /tmp/py-requirements -r ./gpdb_src/gpMgmt/requirements-dev.txt
cp -r /tmp/py-requirements/* /usr/local/greenplum-db-devel/ext/python/
deactivate
+}
+
+function gen_env(){
+ cat > /opt/run_test.sh <<-EOF
+ set -ex
source /usr/local/greenplum-db-devel/greenplum_path.sh
@@ -94,6 +96,7 @@ function _main() {
time (make_cluster)
time install_python_hacks
+ time install_python_requirements
time gen_env
time run_test
