Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Updating of CI-tests #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7d8302f
Test dockerfile for ubuntu 24.04 is added
dmitry-lipetsk Feb 26, 2025
2df2fd4
Cleanup (Dockerfile--ubuntu-24_04)
dmitry-lipetsk Feb 26, 2025
e8bf7d6
Cleanup.
dmitry-lipetsk Feb 27, 2025
103bcd2
[run_tests.sh] A right way for obtaining of BINDIR and PG_CONFIG is …
dmitry-lipetsk Feb 27, 2025
d0eb414
Merge remote-tracking branch 'origin/D20250227_001--pg_config-bindir'…
dmitry-lipetsk Feb 27, 2025
579d20e
Dockerfile--ubuntu-24_04 is updated
dmitry-lipetsk Feb 27, 2025
e87c402
Dockerfile--ubuntu-24_04 is updated (cleanup)
dmitry-lipetsk Feb 27, 2025
b88327d
Merge commit '9911ed0c928b602c17a3b0845b24910bf291925a' into D2025022…
dmitry-lipetsk Feb 27, 2025
126b5a8
Merge commit '6d67da2170becb944fc768ff4938f88b37e0f2a4' into D2025022…
dmitry-lipetsk Feb 27, 2025
96227f5
Dockerfile--ubuntu-24_04 is updated (cleanup)
dmitry-lipetsk Feb 27, 2025
b7bf713
Dockerfile--ubuntu-24_04 is formatted
dmitry-lipetsk Feb 27, 2025
bcb7771
CI-test on Ubuntu 24.04 is added.
dmitry-lipetsk Feb 27, 2025
7d871a2
Dockerfile--std.tmpl is updated (refactoring)
dmitry-lipetsk Feb 27, 2025
381d64d
Dockerfile--ubuntu-24_04.tmpl is updated
dmitry-lipetsk Feb 27, 2025
b5c4d7b
PostgresNode::pid is improved
dmitry-lipetsk Feb 27, 2025
fce595a
PostgresNode::pid is updated
dmitry-lipetsk Feb 27, 2025
a92a6e7
Merge remote-tracking branch 'origin/D20250227_001--node-pid' into D2…
dmitry-lipetsk Feb 27, 2025
0aebc00
Merge branch 'master' into D20250227_001--node-pid
dmitry-lipetsk Feb 28, 2025
ebd6208
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetsk Feb 28, 2025
0863cf5
execute_utility2 is updated (ignore_errors)
dmitry-lipetsk Feb 28, 2025
a4e65bf
Merge branch 'D20250228_001--execute_utility2' into D20250227_001--no…
dmitry-lipetsk Feb 28, 2025
09976ae
PostgresNode::_try_shutdown is rewrited (normalization)
dmitry-lipetsk Feb 28, 2025
ab28c2e
Merge branch '20250228_002--try_shutdown' into D20250227_001--node-pid
dmitry-lipetsk Feb 28, 2025
0402c4a
PostgresNode::pid uses the data from "pg_ctl status" output.
dmitry-lipetsk Feb 28, 2025
c288af8
Merge remote-tracking branch 'origin/D20250227_001--node-pid' into D2…
dmitry-lipetsk Feb 28, 2025
45d2b17
PostgresNode::_try_shutdown is correct (return None)
dmitry-lipetsk Feb 28, 2025
a960ac7
Merge branch '20250228_002--try_shutdown' into D20250227_001--node-pid
dmitry-lipetsk Feb 28, 2025
5c6548f
Merge remote-tracking branch 'origin/D20250227_001--node-pid' into D2…
dmitry-lipetsk Feb 28, 2025
619fefa
[RemoteOperations] A call of mktemp is fixed
dmitry-lipetsk Feb 28, 2025
015b766
Merge remote-tracking branch 'origin/D20250228_001--remote-mktemp' in…
dmitry-lipetsk Feb 28, 2025
82981f5
Merge branch 'master' into D20250227_001--node-pid
dmitry-lipetsk Mar 1, 2025
61d8929
Merge remote-tracking branch 'origin/D20250227_001--node-pid' into D2…
dmitry-lipetsk Mar 1, 2025
3c2b51f
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetsk Mar 1, 2025
76e9c53
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetsk Mar 1, 2025
1309442
Total refactoring of os_ops::execute_command
dmitry-lipetsk Mar 1, 2025
9b7c10e
Merge remote-tracking branch 'origin/D20250301_01--os_ops-exec_comman…
dmitry-lipetsk Mar 1, 2025
e245e23
Dockerfile--ubuntu-24_04.tmpl is updated
dmitry-lipetsk Mar 1, 2025
d843df6
The old behaviour of RaiseError.UtilityExitedWithNonZeroCode is restored
dmitry-lipetsk Mar 1, 2025
afb4a3d
Merge remote-tracking branch 'origin/D20250301_01--os_ops-exec_comman…
dmitry-lipetsk Mar 1, 2025
25c7c0f
TestRemoteOperations::test_is_executable_true is corrected
dmitry-lipetsk Mar 1, 2025
c4cbaf3
Merge branch 'D20250301_002--remote_ops_tests-test_is_executable_true…
dmitry-lipetsk Mar 1, 2025
491b693
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetsk Mar 1, 2025
5cec260
xxx::test_logging is corrected (local, remote)
dmitry-lipetsk Mar 2, 2025
6a70944
Merge remote-tracking branch 'origin/D20250302_001--test_logging' int…
dmitry-lipetsk Mar 2, 2025
d15e29c
TEST_FILTER is added
dmitry-lipetsk Mar 2, 2025
9329f22
CI on Ubuntu 24.04 runs all the tests
dmitry-lipetsk Mar 2, 2025
62ae15c
Merge branch 'master' into D20250226_001--ci_and_ssh
dmitry-lipetsk Mar 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,17 @@ notifications:
on_failure: always

env:
- PYTHON_VERSION=3 PG_VERSION=17
- PYTHON_VERSION=3 PG_VERSION=16
- PYTHON_VERSION=3 PG_VERSION=15
- PYTHON_VERSION=3 PG_VERSION=14
- PYTHON_VERSION=3 PG_VERSION=13
- PYTHON_VERSION=3 PG_VERSION=12
- PYTHON_VERSION=3 PG_VERSION=11
- PYTHON_VERSION=3 PG_VERSION=10
# - PYTHON_VERSION=3 PG_VERSION=9.6
# - PYTHON_VERSION=3 PG_VERSION=9.5
# - PYTHON_VERSION=3 PG_VERSION=9.4
# - PYTHON_VERSION=2 PG_VERSION=10
# - PYTHON_VERSION=2 PG_VERSION=9.6
# - PYTHON_VERSION=2 PG_VERSION=9.5
# - PYTHON_VERSION=2 PG_VERSION=9.4
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=17
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=16
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=15
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=14
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=13
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=12
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=11
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=10
- TEST_PLATFORM=ubuntu-24_04 PYTHON_VERSION=3 PG_VERSION=17

matrix:
allow_failures:
- env: PYTHON_VERSION=3 PG_VERSION=11
- env: PYTHON_VERSION=3 PG_VERSION=10
- env: TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=11
- env: TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=10
6 changes: 1 addition & 5 deletions Dockerfile.tmpl → Dockerfile--std.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ RUN if [ "${PYTHON_VERSION}" = "3" ] ; then \
fi
ENV LANG=C.UTF-8

RUN mkdir -p /pg
COPY run_tests.sh /run.sh
RUN chmod 755 /run.sh

ADD . /pg/testgres
WORKDIR /pg/testgres
RUN chown -R postgres:postgres /pg

USER postgres
ENTRYPOINT PYTHON_VERSION=${PYTHON_VERSION} /run.sh
ENTRYPOINT PYTHON_VERSION=${PYTHON_VERSION} bash run_tests.sh
69 changes: 69 additions & 0 deletions Dockerfile--ubuntu-24_04.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
FROM ubuntu:24.04

RUN apt update
RUN apt install -y sudo curl ca-certificates postgresql-common

RUN bash /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y

RUN install -d /usr/share/postgresql-common/pgdg
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc

# It does not work
# RUN sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

RUN apt update
RUN apt install -y postgresql-${PG_VERSION}

RUN apt install -y python3 python3-dev python3-virtualenv
# RUN apt install -y mc

# It is required for psycopg2
RUN apt install -y libpq-dev
RUN apt install -y openssh-server

# [2025-02-26] It adds the user 'postgres' in the group 'sudo'
# [2025-02-27] It is not required.
# RUN adduser postgres sudo

ADD . /pg/testgres
WORKDIR /pg/testgres
RUN chown -R postgres /pg

EXPOSE 22

RUN ssh-keygen -A

# It enables execution of "sudo service ssh start" without password
RUN sh -c "echo postgres ALL=NOPASSWD:/usr/sbin/service ssh start" >> /etc/sudoers

USER postgres

ENV LANG=C.UTF-8

#ENTRYPOINT PYTHON_VERSION=3.12 /run.sh
ENTRYPOINT sh -c " \
#set -eux; \
echo HELLO FROM ENTRYPOINT; \
echo HOME DIR IS [`realpath ~/`]; \
echo POINT 1; \
chmod go-w /var/lib/postgresql; \
echo POINT 1.5; \
mkdir -p ~/.ssh; \
echo POINT 2; \
service ssh enable; \
echo POINT 3; \
sudo service ssh start; \
echo POINT 4; \
ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \
echo POINT 5; \
ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \
echo POINT 6; \
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \
echo ----; \
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \
echo ----; \
chmod 600 ~/.ssh/authorized_keys; \
echo ----; \
ls -la ~/.ssh/; \
echo ----; \
TEST_FILTER="" PYTHON_VERSION=${PYTHON_VERSION} bash run_tests.sh;"
2 changes: 1 addition & 1 deletion mk_dockerfile.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
set -eu
sed -e 's/${PYTHON_VERSION}/'${PYTHON_VERSION}/g -e 's/${PG_VERSION}/'${PG_VERSION}/g Dockerfile.tmpl > Dockerfile
sed -e 's/${PYTHON_VERSION}/'${PYTHON_VERSION}/g -e 's/${PG_VERSION}/'${PG_VERSION}/g Dockerfile--${TEST_PLATFORM}.tmpl > Dockerfile
7 changes: 4 additions & 3 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

set -eux

if [ -z ${TEST_FILTER+x} ]; then export TEST_FILTER="TestgresTests"; fi

# choose python version
echo python version is $PYTHON_VERSION
Expand Down Expand Up @@ -38,19 +39,19 @@ rm -f $COVERAGE_FILE


# run tests (PATH)
time coverage run -a -m pytest -l -v -n 4 -k "TestgresTests"
time coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}"


# run tests (PG_BIN)
time \
PG_BIN=$(pg_config --bindir) \
coverage run -a -m pytest -l -v -n 4 -k "TestgresTests"
coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}"


# run tests (PG_CONFIG)
time \
PG_CONFIG=$(pg_config --bindir)/pg_config \
coverage run -a -m pytest -l -v -n 4 -k "TestgresTests"
coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}"


# show coverage
Expand Down