Skip to content

Commit d0e6725

Browse files
torsavapkubatrh
authored andcommitted
Add virtualenv and UPGRADE_PIP_TO_LATEST tests
1 parent fe036cb commit d0e6725

6 files changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UPGRADE_PIP_TO_LATEST=1

2.7/test/virtualenv-uwsgi-test-app/app.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/bin/bash
22

3+
# First test virtualenv environment and pip upgrade
4+
5+
echo "Testing that the virtual environment's Python is being used ..."
6+
if [ "$(which python)" != "/opt/app-root/bin/python" ]; then
7+
echo "ERROR: Initialization of the virtual environment failed."
8+
exit 1
9+
fi
10+
11+
echo "Testing UPGRADE_PIP_TO_LATEST=1 (set in .s2i/environment) ..."
12+
pip_major_version=$(pip --version | cut -d" " -f2 | cut -d"." -f1)
13+
if [ -z "$pip_major_version" ] || [ "$pip_major_version" -lt "9" ]; then
14+
echo "ERROR: Failed to upgrade pip to version 9 or later."
15+
exit 1
16+
fi
17+
18+
319
exec uwsgi \
420
--http-socket :8080 \
521
--die-on-term \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UPGRADE_PIP_TO_LATEST=1

3.4/test/virtualenv-uwsgi-test-app/app.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/bin/bash
22

3+
# First test virtualenv environment and pip upgrade
4+
5+
echo "Testing that the virtual environment's Python is being used ..."
6+
if [ "$(which python)" != "/opt/app-root/bin/python" ]; then
7+
echo "ERROR: Initialization of the virtual environment failed."
8+
exit 1
9+
fi
10+
11+
echo "Testing UPGRADE_PIP_TO_LATEST=1 (set in .s2i/environment) ..."
12+
pip_major_version=$(pip --version | cut -d" " -f2 | cut -d"." -f1)
13+
if [ -z "$pip_major_version" ] || [ "$pip_major_version" -lt "9" ]; then
14+
echo "ERROR: Failed to upgrade pip to version 9 or later."
15+
exit 1
16+
fi
17+
18+
319
exec uwsgi \
420
--http-socket :8080 \
521
--die-on-term \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UPGRADE_PIP_TO_LATEST=1

3.5/test/virtualenv-uwsgi-test-app/app.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
#!/bin/bash
22

3+
# First test virtualenv environment and pip upgrade
4+
5+
echo "Testing that the virtual environment's Python is being used ..."
6+
if [ "$(which python)" != "/opt/app-root/bin/python" ]; then
7+
echo "ERROR: Initialization of the virtual environment failed."
8+
exit 1
9+
fi
10+
11+
echo "Testing UPGRADE_PIP_TO_LATEST=1 (set in .s2i/environment) ..."
12+
pip_major_version=$(pip --version | cut -d" " -f2 | cut -d"." -f1)
13+
if [ -z "$pip_major_version" ] || [ "$pip_major_version" -lt "9" ]; then
14+
echo "ERROR: Failed to upgrade pip to version 9 or later."
15+
exit 1
16+
fi
17+
18+
19+
# Now test the uwsgi server
20+
321
exec uwsgi \
422
--http-socket :8080 \
523
--die-on-term \

0 commit comments

Comments
 (0)