Skip to content

Commit 013803a

Browse files
ci: run tests with pip artifacts
Part of #198
1 parent f2c7ffc commit 013803a

File tree

2 files changed

+143
-2
lines changed

2 files changed

+143
-2
lines changed

.github/workflows/packing.yml

+141
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,144 @@ jobs:
5050
with:
5151
name: pip_dist
5252
path: dist
53+
54+
run_tests_pip_package_install_linux:
55+
needs: pack_pip
56+
57+
# We want to run on external PRs, but not on our own internal
58+
# PRs as they'll be run by the push to the branch.
59+
#
60+
# The main trick is described here:
61+
# https://github.com/Dart-Code/Dart-Code/pull/2375
62+
if: (github.event_name == 'push') ||
63+
(github.event_name == 'pull_request' &&
64+
github.event.pull_request.head.repo.full_name != github.repository)
65+
runs-on: ubuntu-20.04
66+
67+
strategy:
68+
fail-fast: false
69+
70+
matrix:
71+
tarantool:
72+
- '2.10'
73+
python:
74+
- '3.6'
75+
- '3.7'
76+
- '3.8'
77+
- '3.9'
78+
- '3.10'
79+
steps:
80+
- name: Clone the connector repo
81+
uses: actions/checkout@v2
82+
83+
- name: Remove connector source code
84+
run: python .github/scripts/remove_source_code.py
85+
86+
- name: Install tarantool ${{ matrix.tarantool }}
87+
uses: tarantool/setup-tarantool@v1
88+
with:
89+
tarantool-version: ${{ matrix.tarantool }}
90+
91+
- name: Setup Python for tests
92+
uses: actions/setup-python@v2
93+
with:
94+
python-version: ${{ matrix.python }}
95+
96+
- name: Download pip package artifact
97+
uses: actions/download-artifact@v3
98+
with:
99+
name: pip_dist
100+
101+
- name: Install the package with pip from artifacts
102+
run: pip install *.whl
103+
104+
- name: Install test requirements
105+
run: pip install -r requirements-test.txt
106+
107+
- name: Run tests
108+
run: python -m unittest discover -v
109+
env:
110+
TEST_PURE_INSTALL: true
111+
112+
run_tests_pip_package_install_windows:
113+
needs: pack_pip
114+
115+
# We want to run on external PRs, but not on our own internal
116+
# PRs as they'll be run by the push to the branch.
117+
#
118+
# The main trick is described here:
119+
# https://github.com/Dart-Code/Dart-Code/pull/2375
120+
if: (github.event_name == 'push') ||
121+
(github.event_name == 'pull_request' &&
122+
github.event.pull_request.head.repo.full_name != github.repository)
123+
124+
runs-on: windows-2022
125+
126+
strategy:
127+
fail-fast: false
128+
129+
matrix:
130+
# Use reduced test matrix cause Windows pipelines are long.
131+
tarantool:
132+
- '2.10.0.g0a5ce0b9c-1'
133+
python:
134+
- '3.6'
135+
- '3.10'
136+
steps:
137+
- name: Clone the connector repo
138+
uses: actions/checkout@v2
139+
140+
- name: Remove connector source code
141+
run: python .github/scripts/remove_source_code.py
142+
143+
- name: Setup Python for tests
144+
uses: actions/setup-python@v2
145+
with:
146+
python-version: ${{ matrix.python }}
147+
148+
- name: Download pip package artifact
149+
uses: actions/download-artifact@v3
150+
with:
151+
name: pip_dist
152+
153+
- name: Install the package with pip from artifacts
154+
run: |
155+
FOR /F %i IN ('where *.whl') DO set WHEEL_FILE=%i
156+
pip install %WHEEL_FILE%
157+
shell: cmd
158+
159+
- name: Install test requirements
160+
run: pip install -r requirements-test.txt
161+
162+
- name: Setup WSL for tarantool
163+
uses: Vampire/setup-wsl@v1
164+
with:
165+
distribution: Ubuntu-20.04
166+
167+
- name: Install tarantool ${{ matrix.tarantool }} for WSL
168+
shell: wsl-bash_Ubuntu-20.04 {0}
169+
run: |
170+
curl -L https://tarantool.io/release/2/installer.sh | bash -s
171+
sudo apt install -y tarantool=${{ matrix.tarantool }} tarantool-dev=${{ matrix.tarantool }}
172+
173+
- name: Setup test tarantool instance
174+
shell: wsl-bash_Ubuntu-20.04 {0}
175+
run: |
176+
rm -f ./tarantool.pid ./tarantool.log
177+
TNT_PID=$(tarantool ./test/suites/lib/tarantool_python_ci.lua > tarantool.log 2>&1 & echo $!)
178+
touch tarantool.pid
179+
echo $TNT_PID > ./tarantool.pid
180+
181+
- name: Run tests
182+
env:
183+
REMOTE_TARANTOOL_HOST: localhost
184+
REMOTE_TARANTOOL_CONSOLE_PORT: 3302
185+
TEST_PURE_INSTALL: true
186+
run: python -m unittest discover -v
187+
188+
- name: Stop test tarantool instance
189+
if: ${{ always() }}
190+
shell: wsl-bash_Ubuntu-20.04 {0}
191+
run: |
192+
cat tarantool.log || true
193+
kill $(cat tarantool.pid) || true

.github/workflows/testing.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
env:
149149
TEST_TNT_SSL: ${{ matrix.tarantool == '2.10.0-1-gfa775b383-r486-linux-x86_64' }}
150150

151-
run_tests_with_install_linux:
151+
run_tests_pip_branch_install_linux:
152152
# We want to run on external PRs, but not on our own internal
153153
# PRs as they'll be run by the push to the branch.
154154
#
@@ -278,7 +278,7 @@ jobs:
278278
cat tarantool.log || true
279279
kill $(cat tarantool.pid) || true
280280
281-
run_tests_with_install_windows:
281+
run_tests_pip_branch_install_windows:
282282
# We want to run on external PRs, but not on our own internal
283283
# PRs as they'll be run by the push to the branch.
284284
#

0 commit comments

Comments
 (0)