Skip to content

Commit 0404715

Browse files
author
d.kovalenko
committed
[CI] A support of travis is added
1 parent 2ddecc4 commit 0404715

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
os: linux
2+
3+
dist: bionic
4+
5+
language: python
6+
7+
services:
8+
- docker
9+
10+
install:
11+
- docker build --build-arg PYTHON_VERSION="${PYTHON_VERSION}" -t tests -f Dockerfile--${TEST_PLATFORM}.tmpl .
12+
13+
script:
14+
- docker run -t tests
15+
16+
notifications:
17+
email:
18+
on_success: change
19+
on_failure: always
20+
21+
env:
22+
- TEST_PLATFORM=std3-all PYTHON_VERSION=3.9
23+
- TEST_PLATFORM=std3-all PYTHON_VERSION=3.10
24+
- TEST_PLATFORM=std3-all PYTHON_VERSION=3.11
25+
- TEST_PLATFORM=std3-all PYTHON_VERSION=3.12
26+
- TEST_PLATFORM=std3-all PYTHON_VERSION=3.13
27+

Dockerfile--std3-all.tmpl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ARG PYTHON_VERSION
2+
3+
# --------------------------------------------- base1
4+
FROM python:${PYTHON_VERSION}-alpine as base1
5+
6+
# --------------------------------------------- final
7+
FROM base1 as final
8+
9+
RUN apk add mc
10+
RUN apk add bash
11+
12+
RUN adduser -D test
13+
14+
ADD . /home/test/testgres
15+
RUN chown -R test /home/test/testgres
16+
WORKDIR /home/test/testgres
17+
18+
USER test
19+
20+
ENTRYPOINT sh -c " \
21+
set -eux; \
22+
bash run_tests3.sh;"

run_tests3.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2017-2025 Postgres Professional
4+
5+
set -eux
6+
7+
# prepare python environment
8+
VENV_PATH="/tmp/testgres_venv"
9+
rm -rf $VENV_PATH
10+
python -m venv "${VENV_PATH}"
11+
export VIRTUAL_ENV_DISABLE_PROMPT=1
12+
source "${VENV_PATH}/bin/activate"
13+
pip install pytest pytest-xdist
14+
15+
# install testgres' dependencies
16+
export PYTHONPATH=$(pwd)
17+
# $PIP install .
18+
19+
pytest -l -v -n 4
20+
21+
set +eux
22+

0 commit comments

Comments
 (0)