Skip to content

Commit

Permalink
Test commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ylobankov committed Feb 18, 2022
1 parent fb39e88 commit b85e568
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 58 deletions.
111 changes: 55 additions & 56 deletions .github/workflows/test.yml
@@ -1,70 +1,69 @@
name: test-run

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
build:
if: ( github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name != github.repository ) &&
( github.repository == 'tarantool/test-run' )
github.event.pull_request.head.repo.full_name != github.repository ) &&
( github.repository == 'tarantool/test-run' )

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.8-dev]
tarantool-version: [2.6, 2.7]
python-version: [ 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 ]
tarantool-version: [ 2.7, 2.8 ]

steps:
- uses: actions/checkout@v2
- name: update git submodules
run: git submodule update --init --recursive
- name: set up Tarantool ${{ matrix.tarantool-version }}
uses: tarantool/setup-tarantool@v1
with:
tarantool-version: ${{ matrix.tarantool-version }}
- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: display python version
run: python -c "import sys; print(sys.version)"
- name: setup dependencies
run: |
sudo apt update -y
sudo apt-get -y install lua5.1 luarocks
sudo luarocks install luacheck
- name: set default pip to pip3
run: |
sudo rm -f /usr/local/bin/pip
sudo ln -s /usr/bin/pip3 /usr/local/bin/pip
- name: set default python and pip to v2.7
if: ${{ matrix.python-version }} == 2.7
run: |
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py
sudo rm -f /usr/bin/python
sudo ln -s /usr/bin/python2 /usr/bin/python
sudo rm -f /usr/local/bin/pip
sudo ln -s /usr/local/bin/pip2 /usr/local/bin/pip
- name: setup python dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: run static analysis
run: |
make lint
- name: run regression tests
run: |
make test
- name: code coverage
if: ${{ matrix.python-version == '3.8' && matrix.tarantool-version == '2.7' }}
run: |
pip install coveralls==3.*
make coverage
- name: upload coverage data to coveralls.io
if: ${{ matrix.python-version == '3.8' && matrix.tarantool-version == '2.7' }}
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive

- name: set up Tarantool ${{ matrix.tarantool-version }}
uses: tarantool/setup-tarantool@v1
with:
tarantool-version: ${{ matrix.tarantool-version }}

- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: display Python version
run: python -c "import sys; print(sys.version)"

- name: setup dependencies
run: |
sudo apt update -y
sudo apt-get -y install lua5.1 luarocks
sudo luarocks install luacheck
- name: setup Python dependencies
run: |
python -m pip install -r requirements.txt
python -m pip install -r requirements-test.txt
- name: run static analysis
run: make lint

- name: run regression tests
run: |
sudo rm /usr/bin/python
make test
- name: code coverage
if: ${{ matrix.python-version == '3.8' &&
matrix.tarantool-version == '2.7' }}
run: |
python -m pip install coveralls==3.*
make coverage
- name: upload coverage data to coveralls.io
if: ${{ matrix.python-version == '3.8' &&
matrix.tarantool-version == '2.7' }}
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 6 additions & 2 deletions test/unittest/test_tarantool_server.py
Expand Up @@ -8,7 +8,7 @@ def test_tarantool_server_not_hanging(self):
env = os.environ.copy()
env['SERVER_START_TIMEOUT'] = '5'

cmd = ['python', 'test/test-run.py', 'unittest/hang.test.lua']
cmd = 'SERVER_START_TIMEOUT=5 python test/test-run.py unittest/hang.test.lua'

box_instance = 'box-cc0544b6afd1'
replica_instance = 'replica-7f4d4895ff58'
Expand All @@ -17,8 +17,12 @@ def test_tarantool_server_not_hanging(self):
err_msg_2 = ('[Instance "%s"] Failed to start within %s seconds'
% (replica_instance, env['SERVER_START_TIMEOUT']))

print(env)
print('****', subprocess.check_output(['which', 'python'], env=env, universal_newlines=True))
print('====', subprocess.check_output(['python', '--version'], env=env, universal_newlines=True))

try:
subprocess.check_output(cmd, env=env, universal_newlines=True)
subprocess.check_output(cmd, shell=True, universal_newlines=True)
self.fail("Command `%s` did not return non-zero exit code"
% ' '.join(cmd))
except subprocess.CalledProcessError as exc:
Expand Down

0 comments on commit b85e568

Please sign in to comment.