Skip to content

Commit 09ef48a

Browse files
ci: setup GitHub Actions testing pipeline
Before this patch, tarantool/tarantool-python CI was based on Travis CI (Linux runs) and Appveyor (Windows runs). This PR introduces GitHub Actions workflow files for both Linux and Windows test runs. Pipelines run for different supported tarantool, Python and msgpack package versions to ensure compatibility. tarantool instance is started in each Windows pipeline under WSL to run tests instead of using an external server (like in Appveyor). Since we start a new tarantool instance for each run, clean() procedure was removed. (The main reason to remove it was failing with "ER_DROP_FUNCTION: Can't drop function 1: function is SQL built-in" error on newer 2.x on bootstrap.) Testing pipeline for tarantool artifacts was also updated. Travis CI and Appveyor badges were replaced with GitHub Actions badge. Closes #182
1 parent 0f95f28 commit 09ef48a

File tree

4 files changed

+245
-8
lines changed

4 files changed

+245
-8
lines changed

Diff for: .github/workflows/reusable_testing.yml

+32-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,26 @@ on:
1212
jobs:
1313
run_tests:
1414
runs-on: ubuntu-20.04
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python:
20+
- '2.7'
21+
- '3.4'
22+
- '3.5'
23+
- '3.6'
24+
- '3.7'
25+
- '3.8'
26+
- '3.9'
27+
- '3.10'
28+
msgpack-deps:
29+
- 'msgpack-python==0.4.0'
30+
- 'msgpack==0.5.0'
31+
- 'msgpack==0.6.2'
32+
- 'msgpack==1.0.0'
33+
# latest msgpack will be installed as a part of requirements.txt
34+
- ''
1535
steps:
1636
- name: Clone the tarantool-python connector
1737
uses: actions/checkout@v2
@@ -28,12 +48,22 @@ jobs:
2848
# dependencies when migrating to other OS version.
2949
run: sudo dpkg -i tarantool*.deb
3050

31-
- name: Setup python3 for tests
51+
- name: Setup Python for tests
3252
uses: actions/setup-python@v2
3353
with:
34-
python-version: 3.7
54+
python-version: ${{ matrix.python }}
55+
56+
- name: Install msgpack python package
57+
if: matrix.msgpack-deps != ''
58+
run: pip install ${{ matrix.msgpack-deps }}
3559

3660
- name: Install connector requirements
61+
# msgpack package is a replacement for deprecated msgpack-python.
62+
# To test compatibility with msgpack-python we must ignore
63+
# requirements.txt install, since it will install newest msgpack.
64+
# Beware that if any new dependency will be added to requirements.txt,
65+
# this step will be invalid.
66+
if: matrix.msgpack-deps != 'msgpack-python==0.4.0'
3767
run: pip install -r requirements.txt
3868

3969
- name: Install test requirements

Diff for: .github/workflows/testing.yml

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
name: testing
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
run_tests_linux:
9+
# We want to run on external PRs, but not on our own internal
10+
# PRs as they'll be run by the push to the branch.
11+
#
12+
# The main trick is described here:
13+
# https://github.com/Dart-Code/Dart-Code/pull/2375
14+
if: github.event_name == 'push' ||
15+
github.event.pull_request.head.repo.full_name != github.repository
16+
17+
runs-on: ubuntu-20.04
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
tarantool:
23+
- '1.10'
24+
- '2.8'
25+
- '2.9'
26+
- '2.x-latest'
27+
python:
28+
- '2.7'
29+
- '3.5'
30+
- '3.6'
31+
- '3.7'
32+
- '3.8'
33+
- '3.9'
34+
- '3.10'
35+
msgpack-deps:
36+
# latest msgpack will be installed as a part of requirements.txt
37+
- ''
38+
39+
# Adding too many elements in three-dimentional matrix results in
40+
# too many test cases, which causes GitHub webpages to fail with
41+
# "This page is taking too long to load." error, so we use pairwise
42+
# testing.
43+
include:
44+
- tarantool: '2.8'
45+
python: '3.10'
46+
msgpack-deps: 'msgpack-python==0.4.0'
47+
- tarantool: '2.8'
48+
python: '3.10'
49+
msgpack-deps: 'msgpack==0.5.0'
50+
- tarantool: '2.8'
51+
python: '3.10'
52+
msgpack-deps: 'msgpack==0.6.2'
53+
- tarantool: '2.8'
54+
python: '3.10'
55+
msgpack-deps: 'msgpack==1.0.0'
56+
57+
steps:
58+
- name: Clone the connector
59+
uses: actions/checkout@v2
60+
61+
- name: Install Tarantool ${{ matrix.tarantool }}
62+
if: matrix.tarantool != '2.x-latest'
63+
uses: tarantool/setup-tarantool@v1
64+
with:
65+
tarantool-version: ${{ matrix.tarantool }}
66+
67+
- name: Install latest Tarantool 2.x
68+
if: matrix.tarantool == '2.x-latest'
69+
run: |
70+
curl -L https://tarantool.io/pre-release/2/installer.sh | sudo bash
71+
sudo apt install -y tarantool tarantool-dev
72+
73+
- name: Setup Python for tests
74+
uses: actions/setup-python@v2
75+
with:
76+
python-version: ${{ matrix.python }}
77+
78+
- name: Install msgpack python package
79+
if: matrix.msgpack-deps != ''
80+
run: pip install ${{ matrix.msgpack-deps }}
81+
82+
- name: Install connector requirements
83+
# msgpack package is a replacement for deprecated msgpack-python.
84+
# To test compatibility with msgpack-python we must ignore
85+
# requirements.txt install, since it will install newest msgpack.
86+
# Beware that if any new dependency will be added to requirements.txt,
87+
# this step will be invalid.
88+
if: matrix.msgpack-deps != 'msgpack-python==0.4.0'
89+
run: pip install -r requirements.txt
90+
91+
- name: Install test requirements
92+
run: pip install -r requirements-test.txt
93+
94+
- name: Run tests
95+
run: make test
96+
97+
run_tests_windows:
98+
# We want to run on external PRs, but not on our own internal
99+
# PRs as they'll be run by the push to the branch.
100+
#
101+
# The main trick is described here:
102+
# https://github.com/Dart-Code/Dart-Code/pull/2375
103+
if: github.event_name == 'push' ||
104+
github.event.pull_request.head.repo.full_name != github.repository
105+
106+
runs-on: windows-2022
107+
108+
strategy:
109+
fail-fast: false
110+
matrix:
111+
tarantool:
112+
- '1.10'
113+
- '2.8'
114+
- '2.9'
115+
- '2.x-latest'
116+
python:
117+
- '2.7'
118+
- '3.4'
119+
- '3.5'
120+
- '3.6'
121+
- '3.7'
122+
- '3.8'
123+
- '3.9'
124+
- '3.10'
125+
msgpack-deps:
126+
# latest msgpack will be installed as a part of requirements.txt
127+
- ''
128+
129+
# Adding too many elements in three-dimentional matrix results in
130+
# too many test cases, which causes GitHub webpages to fail with
131+
# "This page is taking too long to load" error, so we use pairwise
132+
# testing.
133+
include:
134+
- tarantool: '2.8'
135+
python: '3.10'
136+
msgpack-deps: 'msgpack-python==0.4.0'
137+
- tarantool: '2.8'
138+
python: '3.10'
139+
msgpack-deps: 'msgpack==0.5.0'
140+
- tarantool: '2.8'
141+
python: '3.10'
142+
msgpack-deps: 'msgpack==0.6.2'
143+
- tarantool: '2.8'
144+
python: '3.10'
145+
msgpack-deps: 'msgpack==1.0.0'
146+
147+
steps:
148+
- name: Clone the connector
149+
uses: actions/checkout@v2
150+
151+
- name: Setup Python for tests
152+
uses: actions/setup-python@v2
153+
with:
154+
python-version: ${{ matrix.python }}
155+
156+
- name: Install msgpack python package
157+
if: matrix.msgpack-deps != ''
158+
run: pip install ${{ matrix.msgpack-deps }}
159+
160+
- name: Install connector requirements
161+
# msgpack package is a replacement for deprecated msgpack-python.
162+
# To test compatibility with msgpack-python we must ignore
163+
# requirements.txt install, since it will install newest msgpack.
164+
# Beware that if any new dependency will be added to requirements.txt,
165+
# this step will be invalid.
166+
if: matrix.msgpack-deps != 'msgpack-python==0.4.0'
167+
run: pip install -r requirements.txt
168+
169+
- name: Install test requirements
170+
run: pip install -r requirements-test.txt
171+
172+
- name: Setup WSL for Tarantool
173+
uses: Vampire/setup-wsl@v1
174+
with:
175+
distribution: Ubuntu-20.04
176+
177+
- name: Install Tarantool ${{ matrix.tarantool }} for WSL
178+
if: matrix.tarantool != '2.x-latest'
179+
shell: wsl-bash_Ubuntu-20.04 {0}
180+
run: |
181+
curl -L https://tarantool.io/release/${{ matrix.tarantool }}/installer.sh | sudo bash
182+
sudo apt install -y tarantool tarantool-dev
183+
184+
- name: Install latest Tarantool 2.x for WSL
185+
if: matrix.tarantool == '2.x-latest'
186+
shell: wsl-bash_Ubuntu-20.04 {0}
187+
run: |
188+
curl -L https://tarantool.io/pre-release/2/installer.sh | sudo bash
189+
sudo apt install -y tarantool tarantool-dev
190+
191+
- name: Setup test Tarantool instance
192+
shell: wsl-bash_Ubuntu-20.04 {0}
193+
run: |
194+
rm -f ./tarantool.pid ./tarantool.log
195+
TNT_PID=$(tarantool ./test/suites/lib/tarantool_python_ci.lua > tarantool.log 2>&1 & echo $!)
196+
touch tarantool.pid
197+
echo $TNT_PID > ./tarantool.pid
198+
199+
- name: Run tests
200+
env:
201+
REMOTE_TARANTOOL_HOST: localhost
202+
REMOTE_TARANTOOL_CONSOLE_PORT: 3302
203+
run: make test
204+
205+
- name: Stop test Tarantool
206+
if: ${{ always() }}
207+
shell: wsl-bash_Ubuntu-20.04 {0}
208+
run: |
209+
cat tarantool.log || true
210+
kill $(cat tarantool.pid) || true

Diff for: README.rst

+2-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ This package is a pure-python client library for `Tarantool`_.
1111
.. _`GitHub`: https://github.com/tarantool/tarantool-python
1212
.. _`Issue tracker`: https://github.com/tarantool/tarantool-python/issues
1313

14-
.. image:: https://travis-ci.org/tarantool/tarantool-python.svg?branch=master
15-
:target: https://travis-ci.org/tarantool/tarantool-python
16-
17-
.. image:: https://ci.appveyor.com/api/projects/status/github/tarantool/tarantool-python?branch=master
18-
:target: https://ci.appveyor.com/project/tarantool/tarantool-python
14+
.. image:: https://github.com/tarantool/tarantool-python/actions/workflows/testing.yml/badge.svg?branch=master
15+
:target: https://github.com/tarantool/tarantool-python/actions/workflows/testing.yml
1916

2017
Download and Install
2118
--------------------

Diff for: test/suites/lib/tarantool_python_ci.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,5 +343,5 @@ end
343343

344344
-- }}}
345345

346-
clean()
346+
-- clean()
347347
init()

0 commit comments

Comments
 (0)