Skip to content

Commit 44f280b

Browse files
[CI] A run of all tests (local, remote) on Alpine Linux [PY3, PG17] is added (#210)
* Dockerfile to run all tests on Alpine Linux * A run of all the tests on Alpine Linux [PY3, PG17] is added * [CI] The run of [STD, PY3, PG17] is removed It was replaced with [ALPINE, PY3, PG17]. * Test platform "alpine" was renamed with "std.all"
1 parent dbf6626 commit 44f280b

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ notifications:
2020
on_failure: always
2121

2222
env:
23-
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=17
2423
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=16
2524
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=15
2625
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=14
2726
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=13
2827
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=12
2928
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=11
3029
- TEST_PLATFORM=std PYTHON_VERSION=3 PG_VERSION=10
30+
- TEST_PLATFORM=std.all PYTHON_VERSION=3 PG_VERSION=17
3131
- TEST_PLATFORM=ubuntu-24_04 PYTHON_VERSION=3 PG_VERSION=17
3232

3333
matrix:

Dockerfile--std.all.tmpl

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
FROM postgres:${PG_VERSION}-alpine
2+
3+
ENV PYTHON=python${PYTHON_VERSION}
4+
RUN if [ "${PYTHON_VERSION}" = "2" ] ; then \
5+
apk add --no-cache curl python2 python2-dev build-base musl-dev \
6+
linux-headers py-virtualenv py-pip; \
7+
fi
8+
RUN if [ "${PYTHON_VERSION}" = "3" ] ; then \
9+
apk add --no-cache curl python3 python3-dev build-base musl-dev \
10+
linux-headers py-virtualenv; \
11+
fi
12+
13+
#RUN apk add --no-cache mc
14+
15+
# Full version of "ps" command
16+
RUN apk add --no-cache procps
17+
18+
RUN apk add --no-cache openssh
19+
RUN apk add --no-cache sudo
20+
21+
ENV LANG=C.UTF-8
22+
23+
RUN addgroup -S sudo
24+
RUN adduser postgres sudo
25+
26+
EXPOSE 22
27+
RUN ssh-keygen -A
28+
29+
ADD . /pg/testgres
30+
WORKDIR /pg/testgres
31+
RUN chown -R postgres:postgres /pg
32+
33+
# It allows to use sudo without password
34+
RUN sh -c "echo \"postgres ALL=(ALL:ALL) NOPASSWD:ALL\"">>/etc/sudoers
35+
36+
# THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD
37+
RUN sh -c "echo "postgres:*" | chpasswd -e"
38+
39+
USER postgres
40+
41+
# THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD
42+
RUN chmod 700 ~/
43+
44+
RUN mkdir -p ~/.ssh
45+
#RUN chmod 700 ~/.ssh
46+
47+
#ENTRYPOINT PYTHON_VERSION=${PYTHON_VERSION} bash run_tests.sh
48+
49+
ENTRYPOINT sh -c " \
50+
set -eux; \
51+
echo HELLO FROM ENTRYPOINT; \
52+
echo HOME DIR IS [`realpath ~/`]; \
53+
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \
54+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \
55+
chmod 600 ~/.ssh/authorized_keys; \
56+
ls -la ~/.ssh/; \
57+
sudo /usr/sbin/sshd; \
58+
ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \
59+
ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \
60+
TEST_FILTER=\"\" PYTHON_VERSION=${PYTHON_VERSION} bash run_tests.sh;"

0 commit comments

Comments
 (0)