Skip to content

Commit f0bf7a8

Browse files
CI files are updated (#225)
* [CI] work with 'time' is corrected AltLinux 10 does not support the sequential "time <set_env> coverage run ...". Because this OS does not has a builtin command 'time' in bash. https://forum.altlinux.org/index.php?topic=48342.0 We will install 'time' manually and use another command "<set_env> time coverage run ..." that works without problems but it requires to install 'time' on Ubuntu 2024.04, too. AlpineLinux processes a new command line without any problems. * [CI] An initization of python virtualenv is simplified Let's avoid creating useless environment variables.
1 parent ddfaff4 commit f0bf7a8

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

Dockerfile--ubuntu_24_04.tmpl

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN apt update
99
RUN apt install -y sudo curl ca-certificates
1010
RUN apt update
1111
RUN apt install -y openssh-server
12+
RUN apt install -y time
1213

1314
RUN apt update
1415
RUN apt install -y postgresql-common

run_tests.sh

+9-18
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,17 @@ if [ -z ${TEST_FILTER+x} ]; \
88
then export TEST_FILTER="TestgresTests or (TestTestgresCommon and (not remote_ops))"; \
99
fi
1010

11-
# choose python version
12-
echo python version is $PYTHON_VERSION
13-
VIRTUALENV="virtualenv --python=/usr/bin/python$PYTHON_VERSION"
14-
PIP="pip$PYTHON_VERSION"
15-
1611
# fail early
1712
echo check that pg_config is in PATH
1813
command -v pg_config
1914

20-
# prepare environment
21-
VENV_PATH=/tmp/testgres_venv
15+
# prepare python environment
16+
VENV_PATH="/tmp/testgres_venv"
2217
rm -rf $VENV_PATH
23-
$VIRTUALENV $VENV_PATH
18+
virtualenv --python="/usr/bin/python${PYTHON_VERSION}" "${VENV_PATH}"
2419
export VIRTUAL_ENV_DISABLE_PROMPT=1
25-
source $VENV_PATH/bin/activate
26-
27-
# install utilities
28-
$PIP install coverage flake8 psutil Sphinx pytest pytest-xdist psycopg2 six psutil
20+
source "${VENV_PATH}/bin/activate"
21+
pip install coverage flake8 psutil Sphinx pytest pytest-xdist psycopg2 six psutil
2922

3023
# install testgres' dependencies
3124
export PYTHONPATH=$(pwd)
@@ -45,15 +38,13 @@ time coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}"
4538

4639

4740
# run tests (PG_BIN)
48-
time \
49-
PG_BIN=$(pg_config --bindir) \
50-
coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}"
41+
PG_BIN=$(pg_config --bindir) \
42+
time coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}"
5143

5244

5345
# run tests (PG_CONFIG)
54-
time \
55-
PG_CONFIG=$(pg_config --bindir)/pg_config \
56-
coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}"
46+
PG_CONFIG=$(pg_config --bindir)/pg_config \
47+
time coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}"
5748

5849

5950
# show coverage

0 commit comments

Comments
 (0)