Skip to content

Commit

Permalink
ci: run tests with pip package
Browse files Browse the repository at this point in the history
Part of #198
  • Loading branch information
DifferentialOrange committed Nov 9, 2022
1 parent d5bc694 commit caded10
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 2 deletions.
121 changes: 121 additions & 0 deletions .github/workflows/packing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,124 @@ jobs:
path: pip_dist
retention-days: 1
if-no-files-found: error

run_tests_pip_package_linux:
needs: pack_pip

# We want to run on external PRs, but not on our own internal
# PRs as they'll be run by the push to the branch.
#
# The main trick is described here:
# https://github.com/Dart-Code/Dart-Code/pull/2375
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- name: Clone the connector repo
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Remove connector source code
run: python3 .github/scripts/remove_source_code.py

- name: Install tarantool
uses: tarantool/setup-tarantool@v1
with:
tarantool-version: '2.10'

- name: Download pip package artifacts
uses: actions/download-artifact@v3
with:
name: pip_dist
path: pip_dist

- name: Install the package from pip artifacts
run: pip3 install pip_dist/*.whl

- name: Install test requirements
run: pip3 install -r requirements-test.txt

- name: Run tests
run: make test-pure-install

run_tests_pip_package_windows:
needs: pack_pip

# We want to run on external PRs, but not on our own internal
# PRs as they'll be run by the push to the branch.
#
# The main trick is described here:
# https://github.com/Dart-Code/Dart-Code/pull/2375
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository)

runs-on: windows-latest

strategy:
fail-fast: false

steps:
- name: Clone the connector repo
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Remove connector source code
run: python3 .github/scripts/remove_source_code.py

- name: Download pip package artifacts
uses: actions/download-artifact@v3
with:
name: pip_dist
path: pip_dist

- name: Install the package from pip artifacts
run: pip3 install (gci ./pip_dist *.whl).fullname

- name: Install test requirements
run: pip3 install -r requirements-test.txt

- name: Setup WSL for tarantool
uses: Vampire/setup-wsl@v1
with:
distribution: Ubuntu-20.04

- name: Install tarantool
shell: wsl-bash_Ubuntu-20.04 {0}
run: |
curl -L https://tarantool.io/release/2/installer.sh | bash -s
sudo apt install -y tarantool tarantool-dev
- name: Setup test tarantool instance
shell: wsl-bash_Ubuntu-20.04 {0}
run: |
rm -f ./tarantool.pid ./tarantool.log
TNT_PID=$(tarantool ./test/suites/lib/tarantool_python_ci.lua > tarantool.log 2>&1 & echo $!)
touch tarantool.pid
echo $TNT_PID > ./tarantool.pid
- name: Run tests
env:
REMOTE_TARANTOOL_HOST: localhost
REMOTE_TARANTOOL_CONSOLE_PORT: 3302
run: make test-pure-install

- name: Stop test tarantool instance
if: ${{ always() }}
shell: wsl-bash_Ubuntu-20.04 {0}
run: |
cat tarantool.log || true
kill $(cat tarantool.pid) || true
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
env:
TEST_TNT_SSL: ${{ matrix.tarantool == '2.10.0-1-gfa775b383-r486-linux-x86_64' }}

run_tests_with_install_linux:
run_tests_pip_branch_install_linux:
# We want to run on external PRs, but not on our own internal
# PRs as they'll be run by the push to the branch.
#
Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:
cat tarantool.log || true
kill $(cat tarantool.pid) || true
run_tests_with_install_windows:
run_tests_pip_branch_install_windows:
# We want to run on external PRs, but not on our own internal
# PRs as they'll be run by the push to the branch.
#
Expand Down

0 comments on commit caded10

Please sign in to comment.