| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,12 +33,26 @@ case $PY_VER in | |||
| 33 | 33 | exit 1;; | |
| 34 | 34 | esac | |
| 35 | 35 | ||
| 36 | + VENV=$(pwd)/.venv | ||
| 37 | + | ||
| 38 | + cleanup() { | ||
| 39 | + rm -f /tmp/python-gitlab.cfg | ||
| 40 | + docker kill gitlab-test >/dev/null 2>&1 | ||
| 41 | + docker rm gitlab-test >/dev/null 2>&1 | ||
| 42 | + deactivate || true | ||
| 43 | + rm -rf $VENV | ||
| 44 | + } | ||
| 45 | + [ -z "${BUILD_TEST_ENV_AUTO_CLEANUP+set}" ] || { | ||
| 46 | + trap cleanup EXIT | ||
| 47 | + } | ||
| 48 | + | ||
| 36 | 49 | docker run --name gitlab-test --detach --publish 8080:80 \ | |
| 37 | 50 | --publish 2222:22 gpocentek/test-python-gitlab:latest >/dev/null 2>&1 | |
| 38 | 51 | ||
| 39 | 52 | LOGIN='root' | |
| 40 | 53 | PASSWORD='5iveL!fe' | |
| 41 | 54 | CONFIG=/tmp/python-gitlab.cfg | |
| 55 | + GITLAB="gitlab --config-file $CONFIG" | ||
| 42 | 56 | GREEN='\033[0;32m' | |
| 43 | 57 | NC='\033[0m' | |
| 44 | 58 | OK="echo -e ${GREEN}OK${NC}" | |
@@ -74,3 +88,10 @@ EOF | |||
| 74 | 88 | ||
| 75 | 89 | echo "Config file content ($CONFIG):" | |
| 76 | 90 | cat $CONFIG | |
| 91 | + | ||
| 92 | + $VENV_CMD $VENV | ||
| 93 | + . $VENV/bin/activate | ||
| 94 | + pip install -rrequirements.txt | ||
| 95 | + pip install -e . | ||
| 96 | + | ||
| 97 | + sleep 20 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,35 +14,10 @@ | |||
| 14 | 14 | # You should have received a copy of the GNU Lesser General Public License | |
| 15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 16 | 16 | ||
| 17 | - cleanup() { | ||
| 18 | - rm -f /tmp/python-gitlab.cfg | ||
| 19 | - docker kill gitlab-test >/dev/null 2>&1 | ||
| 20 | - docker rm gitlab-test >/dev/null 2>&1 | ||
| 21 | - deactivate || true | ||
| 22 | - rm -rf $VENV | ||
| 23 | - } | ||
| 24 | - trap cleanup EXIT | ||
| 25 | - | ||
| 26 | 17 | setenv_script=$(dirname $0)/build_test_env.sh | |
| 27 | - | ||
| 18 | + BUILD_TEST_ENV_AUTO_CLEANUP=true | ||
| 28 | 19 | . $setenv_script "$@" | |
| 29 | 20 | ||
| 30 | - CONFIG=/tmp/python-gitlab.cfg | ||
| 31 | - GITLAB="gitlab --config-file $CONFIG" | ||
| 32 | - GREEN='\033[0;32m' | ||
| 33 | - NC='\033[0m' | ||
| 34 | - OK="echo -e ${GREEN}OK${NC}" | ||
| 35 | - | ||
| 36 | - VENV=$(pwd)/.venv | ||
| 37 | - | ||
| 38 | - $VENV_CMD $VENV | ||
| 39 | - . $VENV/bin/activate | ||
| 40 | - pip install -rrequirements.txt | ||
| 41 | - pip install -e . | ||
| 42 | - | ||
| 43 | - # NOTE(gpocentek): the first call might fail without a little delay | ||
| 44 | - sleep 20 | ||
| 45 | - | ||
| 46 | 21 | set -e | |
| 47 | 22 | ||
| 48 | 23 | echo -n "Testing project creation... " | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,26 +14,8 @@ | |||
| 14 | 14 | # You should have received a copy of the GNU Lesser General Public License | |
| 15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 16 | 16 | ||
| 17 | - cleanup() { | ||
| 18 | - rm -f /tmp/python-gitlab.cfg | ||
| 19 | - docker kill gitlab-test >/dev/null 2>&1 | ||
| 20 | - docker rm gitlab-test >/dev/null 2>&1 | ||
| 21 | - deactivate || true | ||
| 22 | - rm -rf $VENV | ||
| 23 | - } | ||
| 24 | - trap cleanup EXIT | ||
| 25 | - | ||
| 26 | 17 | setenv_script=$(dirname $0)/build_test_env.sh | |
| 27 | - | ||
| 18 | + BUILD_TEST_ENV_AUTO_CLEANUP=true | ||
| 28 | 19 | . $setenv_script "$@" | |
| 29 | 20 | ||
| 30 | - VENV=$(pwd)/.venv | ||
| 31 | - | ||
| 32 | - $VENV_CMD $VENV | ||
| 33 | - . $VENV/bin/activate | ||
| 34 | - pip install -rrequirements.txt | ||
| 35 | - pip install -e . | ||
| 36 | - | ||
| 37 | - sleep 20 | ||
| 38 | - | ||
| 39 | 21 | python $(dirname $0)/python_test.py | |
| Back | FazBrowse Home | New Git URL |
0 commit comments