Skip to content

Commit

Permalink
ci: Try to fix cache failures when running GH actions (#3604)
Browse files Browse the repository at this point in the history
* ci: Try to fix cache failures when running GH actions

* Update lockfile

* Fix test

* Fix?

* Update test

---------

Co-authored-by: Patrick Arminio <[email protected]>
  • Loading branch information
bellini666 and patrick91 authored Aug 30, 2024
1 parent cafc388 commit 26fa597
Show file tree
Hide file tree
Showing 8 changed files with 913 additions and 1,010 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ jobs:
~/.nox
.nox
key:
${{ runner.os }}-nox-${{ matrix.session.session }}-${{
hashFiles('**/poetry.lock') }}-${{ hashFiles('**/noxfile.py') }}-4
${{ runner.os }}-nox-${{ matrix.session.session }}-${{ env.pythonLocation }}-${{
hashFiles('**/poetry.lock') }}-${{ hashFiles('**/noxfile.py') }}
restore-keys: |
${{ runner.os }}-nox-${{ matrix.session.session }}-${{ env.pythonLocation }}
- run: pip install poetry nox nox-poetry
- run: pip install poetry nox nox-poetry uv
- run: nox -r -t tests -s "${{ matrix.session.session }}"
- uses: actions/upload-artifact@v4
if: ${{ always() }}
Expand All @@ -94,8 +96,6 @@ jobs:
benchmarks:
name: 📈 Benchmarks
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4
Expand All @@ -120,8 +120,6 @@ jobs:
lint:
name: ✨ Lint
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4
Expand All @@ -143,14 +141,12 @@ jobs:
~/.nox
.nox
key:
${{ runner.os }}-nox-lint-${{ matrix.session.session }}-${{
${{ runner.os }}-nox-lint-${{ env.pythonLocation }}-${{
hashFiles('**/poetry.lock') }}-${{ hashFiles('**/noxfile.py') }}
restore-keys: |
${{ runner.os }}-lint-nox-${{ matrix.session.session }}-
${{ runner.os }}-lint-nox-
${{ runner.os }}-nox-lint-${{ env.pythonLocation }}
- run: pip install poetry
- run: pip install nox nox-poetry
- run: pip install poetry nox nox-poetry uv
- run: nox -r -t lint

unit-tests-on-windows:
Expand Down
1 change: 1 addition & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

nox.options.reuse_existing_virtualenvs = True
nox.options.error_on_external_run = True
nox.options.default_venv_backend = "uv"

PYTHON_VERSIONS = ["3.12", "3.11", "3.10", "3.9", "3.8"]
GQL_CORE_VERSIONS = [
Expand Down
1,882 changes: 893 additions & 989 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ email-validator = {version = ">=1.1.3,<3.0.0", optional = false}
freezegun = "^1.2.1"
libcst = {version = ">=1.0.0", optional = false}
MarkupSafe = "2.1.3"
nox = "^2023.4.22"
nox = "^2024.4.15"
nox-poetry = "^1.0.3"
opentelemetry-api = "<2"
opentelemetry-sdk = "<2"
Expand Down
2 changes: 2 additions & 0 deletions strawberry/aiohttp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
)

from aiohttp import web
from aiohttp.multipart import BodyPartReader
from strawberry.aiohttp.handlers import (
GraphQLTransportWSHandler,
GraphQLWSHandler,
Expand Down Expand Up @@ -60,6 +61,7 @@ async def get_form_data(self) -> FormData:
files: Dict[str, Any] = {}

async for field in reader:
assert isinstance(field, BodyPartReader)
assert field.name

if field.filename:
Expand Down
8 changes: 4 additions & 4 deletions tests/typecheckers/test_fields_resolver_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def test():
[
Result(
type="error",
message="""\
Expression of type "int" is incompatible with declared type "str"
\xa0\xa0"int" is incompatible with "str"\
""",
message=(
'Type "int" is not assignable to declared type "str"\n'
'\xa0\xa0"int" is not assignable to "str"'
),
line=12,
column=22,
),
Expand Down
4 changes: 2 additions & 2 deletions tests/websockets/test_graphql_transport_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ async def ws_raw(http_client: HttpClient) -> AsyncGenerator[WebSocketClient, Non
"/graphql", protocols=[GRAPHQL_TRANSPORT_WS_PROTOCOL]
) as ws:
yield ws
await ws.close()
assert ws.closed
await ws.close()
assert ws.closed


@pytest_asyncio.fixture
Expand Down
4 changes: 2 additions & 2 deletions tests/websockets/test_graphql_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async def ws_raw(http_client: HttpClient) -> AsyncGenerator[WebSocketClient, Non
"/graphql", protocols=[GRAPHQL_WS_PROTOCOL]
) as ws:
yield ws
await ws.close()
assert ws.closed
await ws.close()
assert ws.closed


@pytest_asyncio.fixture
Expand Down

0 comments on commit 26fa597

Please sign in to comment.