Skip to content

Commit 6ce4783

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

File tree

1 file changed

+140
-2
lines changed

1 file changed

+140
-2
lines changed

Diff for: .github/workflows/testing.yml

+140-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
#
@@ -199,6 +199,64 @@ jobs:
199199
env:
200200
TEST_PURE_INSTALL: true
201201

202+
run_tests_pip_package_install_linux:
203+
needs: pack_pip
204+
205+
# We want to run on external PRs, but not on our own internal
206+
# PRs as they'll be run by the push to the branch.
207+
#
208+
# The main trick is described here:
209+
# https://github.com/Dart-Code/Dart-Code/pull/2375
210+
if: (github.event_name == 'push') ||
211+
(github.event_name == 'pull_request' &&
212+
github.event.pull_request.head.repo.full_name != github.repository)
213+
runs-on: ubuntu-20.04
214+
215+
strategy:
216+
fail-fast: false
217+
218+
matrix:
219+
tarantool:
220+
- '2.10'
221+
python:
222+
- '3.6'
223+
- '3.7'
224+
- '3.8'
225+
- '3.9'
226+
- '3.10'
227+
steps:
228+
- name: Clone the connector repo
229+
uses: actions/checkout@v2
230+
231+
- name: Remove connector source code
232+
run: python .github/scripts/remove_source_code.py
233+
234+
- name: Install tarantool ${{ matrix.tarantool }}
235+
uses: tarantool/setup-tarantool@v1
236+
with:
237+
tarantool-version: ${{ matrix.tarantool }}
238+
239+
- name: Setup Python for tests
240+
uses: actions/setup-python@v2
241+
with:
242+
python-version: ${{ matrix.python }}
243+
244+
- name: Download pip package artifact
245+
uses: actions/download-artifact@v3
246+
with:
247+
name: pip_dist
248+
249+
- name: Install the package with pip from artifacts
250+
run: pip install pip_dist/*.whl
251+
252+
- name: Install test requirements
253+
run: pip install -r requirements-test.txt
254+
255+
- name: Run tests
256+
run: python -m unittest discover -v
257+
env:
258+
TEST_PURE_INSTALL: true
259+
202260
run_tests_ce_windows:
203261
# We want to run on external PRs, but not on our own internal
204262
# PRs as they'll be run by the push to the branch.
@@ -278,7 +336,7 @@ jobs:
278336
cat tarantool.log || true
279337
kill $(cat tarantool.pid) || true
280338
281-
run_tests_with_install_windows:
339+
run_tests_pip_branch_install_windows:
282340
# We want to run on external PRs, but not on our own internal
283341
# PRs as they'll be run by the push to the branch.
284342
#
@@ -350,3 +408,83 @@ jobs:
350408
run: |
351409
cat tarantool.log || true
352410
kill $(cat tarantool.pid) || true
411+
412+
run_tests_pip_package_install_windows:
413+
needs: pack_pip
414+
415+
# We want to run on external PRs, but not on our own internal
416+
# PRs as they'll be run by the push to the branch.
417+
#
418+
# The main trick is described here:
419+
# https://github.com/Dart-Code/Dart-Code/pull/2375
420+
if: (github.event_name == 'push') ||
421+
(github.event_name == 'pull_request' &&
422+
github.event.pull_request.head.repo.full_name != github.repository)
423+
424+
runs-on: windows-2022
425+
426+
strategy:
427+
fail-fast: false
428+
429+
matrix:
430+
# Use reduced test matrix cause Windows pipelines are long.
431+
tarantool:
432+
- '2.10.0.g0a5ce0b9c-1'
433+
python:
434+
- '3.6'
435+
- '3.10'
436+
steps:
437+
- name: Clone the connector repo
438+
uses: actions/checkout@v2
439+
440+
- name: Remove connector source code
441+
run: python .github/scripts/remove_source_code.py
442+
443+
- name: Setup Python for tests
444+
uses: actions/setup-python@v2
445+
with:
446+
python-version: ${{ matrix.python }}
447+
448+
- name: Download pip package artifact
449+
uses: actions/download-artifact@v3
450+
with:
451+
name: pip_dist
452+
453+
- name: Install the package with pip from artifacts
454+
run: pip install pip_dist/*.whl
455+
456+
- name: Install test requirements
457+
run: pip install -r requirements-test.txt
458+
459+
- name: Setup WSL for tarantool
460+
uses: Vampire/setup-wsl@v1
461+
with:
462+
distribution: Ubuntu-20.04
463+
464+
- name: Install tarantool ${{ matrix.tarantool }} for WSL
465+
shell: wsl-bash_Ubuntu-20.04 {0}
466+
run: |
467+
curl -L https://tarantool.io/release/2/installer.sh | bash -s
468+
sudo apt install -y tarantool=${{ matrix.tarantool }} tarantool-dev=${{ matrix.tarantool }}
469+
470+
- name: Setup test tarantool instance
471+
shell: wsl-bash_Ubuntu-20.04 {0}
472+
run: |
473+
rm -f ./tarantool.pid ./tarantool.log
474+
TNT_PID=$(tarantool ./test/suites/lib/tarantool_python_ci.lua > tarantool.log 2>&1 & echo $!)
475+
touch tarantool.pid
476+
echo $TNT_PID > ./tarantool.pid
477+
478+
- name: Run tests
479+
env:
480+
REMOTE_TARANTOOL_HOST: localhost
481+
REMOTE_TARANTOOL_CONSOLE_PORT: 3302
482+
TEST_PURE_INSTALL: true
483+
run: python -m unittest discover -v
484+
485+
- name: Stop test tarantool instance
486+
if: ${{ always() }}
487+
shell: wsl-bash_Ubuntu-20.04 {0}
488+
run: |
489+
cat tarantool.log || true
490+
kill $(cat tarantool.pid) || true

0 commit comments

Comments
 (0)