Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade CI tools: Kubernetes to 1.25 (drop 1.21), Ubuntu to 22.04, MyPy to 0.981 #964

Merged
merged 4 commits into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
linters:
name: Linting and static analysis
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 5 # usually 1-2, rarely 3 mins (because of installations)
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
install-extras: [ "", "full-auth" ]
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
name: Python ${{ matrix.python-version }} ${{ matrix.install-extras }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 5 # usually 2-3 mins
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
install-extras: [ "", "full-auth" ]
python-version: [ "pypy-3.7", "pypy-3.8", "pypy-3.9" ]
name: Python ${{ matrix.python-version }} ${{ matrix.install-extras }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
Expand All @@ -100,9 +100,9 @@ jobs:
strategy:
fail-fast: false
matrix:
k3s: [latest, v1.23, v1.22, v1.21]
k3s: [latest, v1.24, v1.23, v1.22]
name: K3s ${{matrix.k3s}}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 10 # usually 4-5 mins
steps:
- uses: actions/checkout@v2
Expand All @@ -119,7 +119,7 @@ jobs:
coveralls-finish:
name: Finalize coveralls.io
needs: [unit-tests, pypy-tests, functional]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-python@v2
- run: pip install coveralls
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/thorough.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
linters:
name: Linting and static analysis
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 5 # usually 1-2, rarely 3 mins (because of installations)
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
install-extras: [ "", "full-auth" ]
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
name: Python ${{ matrix.python-version }} ${{ matrix.install-extras }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 5 # usually 2-3 mins
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
install-extras: [ "", "full-auth" ]
python-version: [ "pypy-3.7", "pypy-3.8", "pypy-3.9" ]
name: Python ${{ matrix.python-version }} ${{ matrix.install-extras }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
Expand All @@ -104,9 +104,9 @@ jobs:
strategy:
fail-fast: false
matrix:
k3s: [latest, v1.23, v1.22, v1.21]
k3s: [latest, v1.24, v1.23, v1.22]
name: K3s ${{matrix.k3s}}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 10 # usually 4-5 mins
steps:
- uses: actions/checkout@v2
Expand All @@ -124,9 +124,9 @@ jobs:
strategy:
fail-fast: false
matrix:
k8s: [latest, v1.23.7, v1.22.10, v1.21.13]
k8s: [latest, v1.24.6, v1.23.12, v1.22.15]
name: K8s ${{matrix.k8s}}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 10 # usually 4-5 mins
env:
K8S: ${{ matrix.k8s }}
Expand All @@ -142,7 +142,7 @@ jobs:
coveralls-finish:
name: Finalize coveralls.io
needs: [unit-tests, pypy-tests, functional]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-python@v2
- run: pip install coveralls
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import-linter
isort
lxml
# Mypy requires typed-ast, which is broken on PyPy 3.7 (could work in PyPy 3.8).
mypy==0.942; implementation_name == "cpython"
mypy==0.981; implementation_name == "cpython"
pre-commit
pyngrok
pytest>=6.0.0
Expand Down
17 changes: 11 additions & 6 deletions tests/apis/test_api_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,17 @@ async def serve_slowly():
async def test_stopper_in_streams(
resp_mocker, aresponses, hostname, method, delay, expected, settings, logger):

async def stream_slowly(request: aiohttp.ClientRequest):
async def stream_slowly(request: aiohttp.web.Request) -> aiohttp.web.StreamResponse:
response = aiohttp.web.StreamResponse()
await response.prepare(request)
await asyncio.sleep(0.05)
await response.write(b'{"fake": "result1"}\n')
await asyncio.sleep(0.15)
await response.write(b'{"fake": "result2"}\n')
await response.write_eof()
try:
await asyncio.sleep(0.05)
await response.write(b'{"fake": "result1"}\n')
await asyncio.sleep(0.15)
await response.write(b'{"fake": "result2"}\n')
await response.write_eof()
except ConnectionError:
pass
return response

aresponses.add(hostname, '/url', method, stream_slowly)
Expand All @@ -256,3 +259,5 @@ async def stream_slowly(request: aiohttp.ClientRequest):
items.append(item)

assert items == expected

await asyncio.sleep(0.2) # give the response some time to be cancelled and its tasks closed