Skip to content

Commit f9f4e7f

Browse files
committed
Have nox run the legacy protobuf test
1 parent 6c2206c commit f9f4e7f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/unittest.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
- "3.12"
4646
- "3.13"
4747
- "3.14"
48+
option:
49+
- ""
50+
- "_protobuf_4x"
4851
steps:
4952
- name: Checkout
5053
uses: actions/checkout@v4
@@ -59,14 +62,14 @@ jobs:
5962
python -m pip install nox
6063
- name: Run unit tests
6164
env:
62-
COVERAGE_FILE: .coverage-${{matrix.python }}
65+
COVERAGE_FILE: .coverage${{ matrix.option }}-${{matrix.python }}
6366
run: |
64-
nox -s unit-${{ matrix.python }}
67+
nox -s unit${{ matrix.option }}-${{ matrix.python }}
6568
- name: Upload coverage results
6669
uses: actions/upload-artifact@v4
6770
with:
6871
name: coverage-artifact-${{ matrix.python }}
69-
path: .coverage-${{ matrix.python }}
72+
path: .coverage${{ matrix.option }}-${{ matrix.python }}
7073
include-hidden-files: true
7174

7275
report-coverage:

noxfile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,12 @@ def unit(session, install_grpc_gcp, install_grpc, install_async_rest):
252252

253253

254254
# TODO: Remove once we stop support for protobuf 4.x.
255-
@nox.session(python="3.11")
255+
@nox.session(python=PYTHON_VERSIONS)
256256
def unit_protobuf_4x(session):
257257
"""Run the unit test suite with protobuf 4.x."""
258+
if session.python > "3.11":
259+
session.log("Skipping session: protobuf 4.x only runs on Python < 3.12")
260+
session.skip()
258261
# Pin protobuf to a 4.x version to ensure coverage for the legacy code path.
259262
session.install("protobuf>=4.25.8,<5.0.0")
260263
default(session, install_grpc=True)

0 commit comments

Comments
 (0)