Skip to content

Commit 1c03553

Browse files
committed
IGNITE-18006 Remove travis, add github actions
1 parent ef1d248 commit 1c03553

File tree

6 files changed

+66
-67
lines changed

6 files changed

+66
-67
lines changed

.github/workflows/pr_check.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Python package
17+
on: [push, pull_request]
18+
19+
env:
20+
IGNITE_VERSION: 2.14.0
21+
IGNITE_HOME: /opt/ignite
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
cfg:
29+
- {python: "3.7", toxenv: "py37"}
30+
- {python: "3.8", toxenv: "py38"}
31+
- {python: "3.9", toxenv: "py39"}
32+
- {python: "3.10", toxenv: "py310"}
33+
- {python: "3.11", toxenv: "py311"}
34+
- {python: "3.11", toxenv: "codestyle"}
35+
36+
steps:
37+
- uses: actions/checkout@v3
38+
- name: Set up Python ${{ matrix.python-version }}
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.cfg.python}}
42+
- name: Install Apache Ignite
43+
run: |
44+
curl -L https://apache-mirror.rbc.ru/pub/apache/ignite/${IGNITE_VERSION}/apache-ignite-slim-${IGNITE_VERSION}-bin.zip > ignite.zip
45+
unzip ignite.zip -d /opt
46+
mv /opt/apache-ignite-slim-${IGNITE_VERSION}-bin /opt/ignite
47+
mv /opt/ignite/libs/optional/ignite-log4j2 /opt/ignite/libs/
48+
49+
- name: Install tox
50+
run: |
51+
pip install tox
52+
53+
- name: Run tests
54+
run: |
55+
pip install tox
56+
tox -e ${{ matrix.cfg.toxenv }}

.travis.yml

-54
This file was deleted.

requirements/tests.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# these packages are used for testing
22

3-
async_generator==1.10; python_version < '3.7'
4-
pytest==6.2.2
3+
pytest==6.2.5
54
pytest-cov==2.11.1
65
pytest-asyncio==0.14.0
76
teamcity-messages==1.28

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def run_setup(with_binary=True):
110110
'Programming Language :: Python :: 3.8',
111111
'Programming Language :: Python :: 3.9',
112112
'Programming Language :: Python :: 3.10',
113+
'Programming Language :: Python :: 3.11',
113114
'Programming Language :: Python :: 3 :: Only',
114115
'Intended Audience :: Developers',
115116
'Topic :: Database :: Front-Ends',

tests/custom/test_timeouts.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
# limitations under the License.
1515
import asyncio
1616
import sys
17-
import time
18-
from asyncio.exceptions import TimeoutError, InvalidStateError
17+
from asyncio import TimeoutError, InvalidStateError
1918

2019
import pytest
2120

@@ -73,10 +72,12 @@ async def test_cancellation_on_slow_response(event_loop, proxy, invalid_states_e
7372
c = AioClient(partition_aware=False)
7473
async with c.connect("127.0.0.1", 10802):
7574
cache = await c.get_cache("test")
76-
proxy.slow_response = True
75+
proxy.discard_response = True # Simulate slow response by discarding it
76+
7777
with pytest.raises(TimeoutError):
7878
await asyncio.wait_for(cache.put(1, 2), 0.1)
7979

80+
proxy.discard_response = False
8081
assert len(invalid_states_errors) == 0
8182

8283

@@ -96,15 +97,14 @@ async def test_cancellation_on_disconnect(event_loop, proxy, invalid_states_erro
9697

9798
class ProxyServer:
9899
"""
99-
Proxy for simulating slow or discarding response ignite server
100-
Set `slow_response`, `discard_response` to `True` to simulate these conditions.
100+
Proxy for simulating discarding response from ignite server
101+
Set `discard_response` to `True` to simulate this condition.
101102
Call `disconnect_peers()` in order to simulate lost connection to Ignite server.
102103
"""
103104
def __init__(self, local_host, remote_host):
104105
self.local_host = local_host
105106
self.remote_host = remote_host
106107
self.peers = {}
107-
self.slow_response = False
108108
self.discard_response = False
109109
self.server = None
110110

@@ -206,7 +206,4 @@ def data_received(self, data):
206206
if self.proxy.discard_response:
207207
return
208208

209-
if self.proxy.slow_response:
210-
time.sleep(0.5)
211-
212209
self.proxy_protocol.transport.write(data)

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
[tox]
1717
skipsdist = True
18-
envlist = codestyle,py{37,38,39,310}
18+
envlist = codestyle,py{37,38,39,310,311}
1919

2020
[pytest]
2121
log_format = %(asctime)s %(name)s %(levelname)s %(message)s
@@ -43,6 +43,6 @@ usedevelop = True
4343
commands =
4444
pytest {env:PYTESTARGS:} {posargs} --force-cext --examples
4545

46-
[testenv:py{36,37,38,39}-jenkins]
46+
[testenv:py{37,38,39,310,311}-jenkins]
4747
setenv:
4848
PYTESTARGS = --junitxml=junit-{envname}.xml

0 commit comments

Comments
 (0)