Skip to content

[CI] A run of all tests (local, remote) on Alpine Linux [PY3, PG17] is added #210

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 4 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ notifications:
on_failure: always

env:
- 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=std.all PYTHON_VERSION=3 PG_VERSION=17
- TEST_PLATFORM=ubuntu-24_04 PYTHON_VERSION=3 PG_VERSION=17

matrix:
Expand Down
60 changes: 60 additions & 0 deletions Dockerfile--std.all.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
FROM postgres:${PG_VERSION}-alpine

ENV PYTHON=python${PYTHON_VERSION}
RUN if [ "${PYTHON_VERSION}" = "2" ] ; then \
apk add --no-cache curl python2 python2-dev build-base musl-dev \
linux-headers py-virtualenv py-pip; \
fi
RUN if [ "${PYTHON_VERSION}" = "3" ] ; then \
apk add --no-cache curl python3 python3-dev build-base musl-dev \
linux-headers py-virtualenv; \
fi

#RUN apk add --no-cache mc

# Full version of "ps" command
RUN apk add --no-cache procps

RUN apk add --no-cache openssh
RUN apk add --no-cache sudo

ENV LANG=C.UTF-8

RUN addgroup -S sudo
RUN adduser postgres sudo

EXPOSE 22
RUN ssh-keygen -A

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

# It allows to use sudo without password
RUN sh -c "echo \"postgres ALL=(ALL:ALL) NOPASSWD:ALL\"">>/etc/sudoers

# THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD
RUN sh -c "echo "postgres:*" | chpasswd -e"

USER postgres

# THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD
RUN chmod 700 ~/

RUN mkdir -p ~/.ssh
#RUN chmod 700 ~/.ssh

#ENTRYPOINT PYTHON_VERSION=${PYTHON_VERSION} bash run_tests.sh

ENTRYPOINT sh -c " \
set -eux; \
echo HELLO FROM ENTRYPOINT; \
echo HOME DIR IS [`realpath ~/`]; \
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \
chmod 600 ~/.ssh/authorized_keys; \
ls -la ~/.ssh/; \
sudo /usr/sbin/sshd; \
ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \
ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \
TEST_FILTER=\"\" PYTHON_VERSION=${PYTHON_VERSION} bash run_tests.sh;"