Skip to content

Commit 8966797

Browse files
ci: run tests with pip artifacts
Part of #198
1 parent 12597cb commit 8966797

File tree

2 files changed

+142
-2
lines changed

2 files changed

+142
-2
lines changed

Diff for: .github/workflows/packing.yml

+140
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,143 @@ jobs:
5151
name: pip_dist
5252
path: dist
5353
retention-days: 1
54+
55+
run_tests_pip_package_install_linux:
56+
needs: pack_pip
57+
58+
# We want to run on external PRs, but not on our own internal
59+
# PRs as they'll be run by the push to the branch.
60+
#
61+
# The main trick is described here:
62+
# https://github.com/Dart-Code/Dart-Code/pull/2375
63+
if: (github.event_name == 'push') ||
64+
(github.event_name == 'pull_request' &&
65+
github.event.pull_request.head.repo.full_name != github.repository)
66+
runs-on: ubuntu-20.04
67+
68+
strategy:
69+
fail-fast: false
70+
71+
matrix:
72+
tarantool:
73+
- '2.10'
74+
python:
75+
- '3.6'
76+
- '3.7'
77+
- '3.8'
78+
- '3.9'
79+
- '3.10'
80+
steps:
81+
- name: Clone the connector repo
82+
uses: actions/checkout@v2
83+
84+
- name: Remove connector source code
85+
run: python .github/scripts/remove_source_code.py
86+
87+
- name: Install tarantool ${{ matrix.tarantool }}
88+
uses: tarantool/setup-tarantool@v1
89+
with:
90+
tarantool-version: ${{ matrix.tarantool }}
91+
92+
- name: Setup Python for tests
93+
uses: actions/setup-python@v2
94+
with:
95+
python-version: ${{ matrix.python }}
96+
97+
- name: Download pip package artifact
98+
uses: actions/download-artifact@v3
99+
with:
100+
name: pip_dist
101+
102+
- name: Install the package with pip from artifacts
103+
run: pip install *.whl
104+
105+
- name: Install test requirements
106+
run: pip install -r requirements-test.txt
107+
108+
- name: Run tests
109+
run: python -m unittest discover -v
110+
env:
111+
TEST_PURE_INSTALL: true
112+
113+
run_tests_pip_package_install_windows:
114+
needs: pack_pip
115+
116+
# We want to run on external PRs, but not on our own internal
117+
# PRs as they'll be run by the push to the branch.
118+
#
119+
# The main trick is described here:
120+
# https://github.com/Dart-Code/Dart-Code/pull/2375
121+
if: (github.event_name == 'push') ||
122+
(github.event_name == 'pull_request' &&
123+
github.event.pull_request.head.repo.full_name != github.repository)
124+
125+
runs-on: windows-2022
126+
127+
strategy:
128+
fail-fast: false
129+
130+
matrix:
131+
# Use reduced test matrix cause Windows pipelines are long.
132+
tarantool:
133+
- '2.10.0.g0a5ce0b9c-1'
134+
python:
135+
- '3.6'
136+
- '3.10'
137+
steps:
138+
- name: Clone the connector repo
139+
uses: actions/checkout@v2
140+
141+
- name: Remove connector source code
142+
run: python .github/scripts/remove_source_code.py
143+
144+
- name: Setup Python for tests
145+
uses: actions/setup-python@v2
146+
with:
147+
python-version: ${{ matrix.python }}
148+
149+
- name: Download pip package artifact
150+
uses: actions/download-artifact@v3
151+
with:
152+
name: pip_dist
153+
154+
- name: Install the package with pip from artifacts
155+
run: |
156+
$env:WHEEL_FILE=$(where *.whl)
157+
pip install $env:WHEEL_FILE
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

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)