Skip to content

Commit fb8cbe0

Browse files
ci: run tests with pip package
Part of #198
1 parent 86b08ee commit fb8cbe0

File tree

2 files changed

+123
-2
lines changed

2 files changed

+123
-2
lines changed

Diff for: .github/workflows/packing.yml

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