Skip to content

Commit ca326ec

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

File tree

2 files changed

+140
-2
lines changed

2 files changed

+140
-2
lines changed

Diff for: .github/workflows/packing.yml

+138
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,141 @@ 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: pip install *.whl
155+
156+
- name: Install test requirements
157+
run: pip install -r requirements-test.txt
158+
159+
- name: Setup WSL for tarantool
160+
uses: Vampire/setup-wsl@v1
161+
with:
162+
distribution: Ubuntu-20.04
163+
164+
- name: Install tarantool ${{ matrix.tarantool }} for WSL
165+
shell: wsl-bash_Ubuntu-20.04 {0}
166+
run: |
167+
curl -L https://tarantool.io/release/2/installer.sh | bash -s
168+
sudo apt install -y tarantool=${{ matrix.tarantool }} tarantool-dev=${{ matrix.tarantool }}
169+
170+
- name: Setup test tarantool instance
171+
shell: wsl-bash_Ubuntu-20.04 {0}
172+
run: |
173+
rm -f ./tarantool.pid ./tarantool.log
174+
TNT_PID=$(tarantool ./test/suites/lib/tarantool_python_ci.lua > tarantool.log 2>&1 & echo $!)
175+
touch tarantool.pid
176+
echo $TNT_PID > ./tarantool.pid
177+
178+
- name: Run tests
179+
env:
180+
REMOTE_TARANTOOL_HOST: localhost
181+
REMOTE_TARANTOOL_CONSOLE_PORT: 3302
182+
TEST_PURE_INSTALL: true
183+
run: python -m unittest discover -v
184+
185+
- name: Stop test tarantool instance
186+
if: ${{ always() }}
187+
shell: wsl-bash_Ubuntu-20.04 {0}
188+
run: |
189+
cat tarantool.log || true
190+
kill $(cat tarantool.pid) || true

Diff for: .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)