File tree Expand file tree Collapse file tree 3 files changed +23
-45
lines changed
Expand file tree Collapse file tree 3 files changed +23
-45
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,26 @@ case $PY_VER in
3333 exit 1;;
3434esac
3535
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+
3649docker run --name gitlab-test --detach --publish 8080:80 \
3750 --publish 2222:22 gpocentek/test-python-gitlab:latest > /dev/null 2>&1
3851
3952LOGIN=' root'
4053PASSWORD=' 5iveL!fe'
4154CONFIG=/tmp/python-gitlab.cfg
55+ GITLAB=" gitlab --config-file $CONFIG "
4256GREEN=' \033[0;32m'
4357NC=' \033[0m'
4458OK=" echo -e ${GREEN} OK${NC} "
7488
7589echo " Config file content ($CONFIG ):"
7690cat $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 1414# You should have received a copy of the GNU Lesser General Public License
1515# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
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-
2617setenv_script=$( dirname $0 ) /build_test_env.sh
27-
18+ BUILD_TEST_ENV_AUTO_CLEANUP=true
2819. $setenv_script " $@ "
2920
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-
4621set -e
4722
4823echo -n " Testing project creation... "
Original file line number Diff line number Diff line change 1414# You should have received a copy of the GNU Lesser General Public License
1515# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
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-
2617setenv_script=$( dirname $0 ) /build_test_env.sh
27-
18+ BUILD_TEST_ENV_AUTO_CLEANUP=true
2819. $setenv_script " $@ "
2920
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-
3921python $( dirname $0 ) /python_test.py
You can’t perform that action at this time.
0 commit comments