Skip to content

Commit 5378649

Browse files
ci: run tests with pip package
Part of #198
1 parent b333af0 commit 5378649

File tree

2 files changed

+123
-2
lines changed

2 files changed

+123
-2
lines changed

.github/workflows/packing.yml

+121
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,124 @@ jobs:
5353
path: pip_dist
5454
retention-days: 1
5555
if-no-files-found: error
56+
57+
run_tests_pip_package_linux:
58+
needs: pack_pip
59+
60+
# We want to run on external PRs, but not on our own internal
61+
# PRs as they'll be run by the push to the branch.
62+
#
63+
# The main trick is described here:
64+
# https://github.com/Dart-Code/Dart-Code/pull/2375
65+
if: (github.event_name == 'push') ||
66+
(github.event_name == 'pull_request' &&
67+
github.event.pull_request.head.repo.full_name != github.repository)
68+
runs-on: ubuntu-latest
69+
70+
strategy:
71+
fail-fast: false
72+
73+
steps:
74+
- name: Clone the connector repo
75+
uses: actions/checkout@v3
76+
77+
- name: Setup Python
78+
uses: actions/setup-python@v4
79+
with:
80+
python-version: '3.10'
81+
82+
- name: Remove connector source code
83+
run: python3 .github/scripts/remove_source_code.py
84+
85+
- name: Install tarantool
86+
uses: tarantool/setup-tarantool@v1
87+
with:
88+
tarantool-version: '2.10'
89+
90+
- name: Download pip package artifacts
91+
uses: actions/download-artifact@v3
92+
with:
93+
name: pip_dist
94+
path: pip_dist
95+
96+
- name: Install the package from pip artifacts
97+
run: pip3 install pip_dist/*.whl
98+
99+
- name: Install test requirements
100+
run: pip3 install -r requirements-test.txt
101+
102+
- name: Run tests
103+
run: make test-pure-install
104+
105+
run_tests_pip_package_windows:
106+
needs: pack_pip
107+
108+
# We want to run on external PRs, but not on our own internal
109+
# PRs as they'll be run by the push to the branch.
110+
#
111+
# The main trick is described here:
112+
# https://github.com/Dart-Code/Dart-Code/pull/2375
113+
if: (github.event_name == 'push') ||
114+
(github.event_name == 'pull_request' &&
115+
github.event.pull_request.head.repo.full_name != github.repository)
116+
117+
runs-on: windows-latest
118+
119+
strategy:
120+
fail-fast: false
121+
122+
steps:
123+
- name: Clone the connector repo
124+
uses: actions/checkout@v3
125+
126+
- name: Setup Python
127+
uses: actions/setup-python@v4
128+
with:
129+
python-version: '3.10'
130+
131+
- name: Remove connector source code
132+
run: python3 .github/scripts/remove_source_code.py
133+
134+
- name: Download pip package artifacts
135+
uses: actions/download-artifact@v3
136+
with:
137+
name: pip_dist
138+
path: pip_dist
139+
140+
- name: Install the package from pip artifacts
141+
run: pip3 install (gci ./pip_dist *.whl).fullname
142+
143+
- name: Install test requirements
144+
run: pip3 install -r requirements-test.txt
145+
146+
- name: Setup WSL for tarantool
147+
uses: Vampire/setup-wsl@v1
148+
with:
149+
distribution: Ubuntu-20.04
150+
151+
- name: Install tarantool
152+
shell: wsl-bash_Ubuntu-20.04 {0}
153+
run: |
154+
curl -L https://tarantool.io/release/2/installer.sh | bash -s
155+
sudo apt install -y tarantool tarantool-dev
156+
157+
- name: Setup test tarantool instance
158+
shell: wsl-bash_Ubuntu-20.04 {0}
159+
run: |
160+
rm -f ./tarantool.pid ./tarantool.log
161+
TNT_PID=$(tarantool ./test/suites/lib/tarantool_python_ci.lua > tarantool.log 2>&1 & echo $!)
162+
touch tarantool.pid
163+
echo $TNT_PID > ./tarantool.pid
164+
165+
- name: Run tests
166+
env:
167+
REMOTE_TARANTOOL_HOST: localhost
168+
REMOTE_TARANTOOL_CONSOLE_PORT: 3302
169+
run: make test-pure-install
170+
171+
- name: Stop test tarantool instance
172+
if: ${{ always() }}
173+
shell: wsl-bash_Ubuntu-20.04 {0}
174+
run: |
175+
cat tarantool.log || true
176+
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
#
@@ -276,7 +276,7 @@ jobs:
276276
cat tarantool.log || true
277277
kill $(cat tarantool.pid) || true
278278
279-
run_tests_with_install_windows:
279+
run_tests_pip_branch_install_windows:
280280
# We want to run on external PRs, but not on our own internal
281281
# PRs as they'll be run by the push to the branch.
282282
#

0 commit comments

Comments
 (0)