Skip to content

Commit 0398a28

Browse files
committed
don't run util tests on py3.14 win - grpcio is missing there
1 parent 2dac41d commit 0398a28

File tree

5 files changed

+8
-39
lines changed

5 files changed

+8
-39
lines changed

.github/workflows/templates/test.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ env:
3030

3131
jobs:
3232
{%- for job_data in job_datas %}
33+
{#- grpcio has no wheel for free-threaded Python on Windows; Ubuntu builds from source fine #}
34+
{%- if not ("py314t" in job_data.tox_env and "test-opentelemetry-test-utils" in job_data.tox_env and job_data.os == "windows-latest") %}
3335

3436
{{ job_data.name }}:
3537
name: {{ job_data.ui_name }}
@@ -71,4 +73,5 @@ jobs:
7173

7274
- name: Run tests
7375
run: tox -e {{ job_data.tox_env }} -- -ra
76+
{%- endif %}
7477
{%- endfor %}

.github/workflows/test.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6260,27 +6260,6 @@ jobs:
62606260
- name: Run tests
62616261
run: tox -e py314-test-opentelemetry-test-utils -- -ra
62626262

6263-
py314t-test-opentelemetry-test-utils_windows-latest:
6264-
name: opentelemetry-test-utils 3.14t Windows
6265-
runs-on: windows-latest
6266-
timeout-minutes: 30
6267-
steps:
6268-
- name: Configure git to support long filenames
6269-
run: git config --system core.longpaths true
6270-
- name: Checkout repo @ SHA - ${{ github.sha }}
6271-
uses: actions/checkout@v4
6272-
6273-
- name: Set up Python 3.14t
6274-
uses: actions/setup-python@v5
6275-
with:
6276-
python-version: "3.14t"
6277-
6278-
- name: Install tox
6279-
run: pip install tox-uv
6280-
6281-
- name: Run tests
6282-
run: tox -e py314t-test-opentelemetry-test-utils -- -ra
6283-
62846263
pypy3-test-opentelemetry-test-utils_windows-latest:
62856264
name: opentelemetry-test-utils pypy-3.10 Windows
62866265
runs-on: windows-latest

tests/opentelemetry-test-utils/test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ zipp==3.19.2
1515
-e tests/opentelemetry-test-utils
1616
-e opentelemetry-proto
1717
-e exporter/opentelemetry-exporter-otlp-proto-common
18+
-e exporter/opentelemetry-exporter-otlp-proto-grpc

tests/opentelemetry-test-utils/tests/test_weaver_live_check.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,9 @@
2222
import shutil
2323
import unittest
2424

25-
try:
26-
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
27-
OTLPSpanExporter,
28-
)
29-
30-
_HAS_GRPC_EXPORTER = True
31-
except ImportError:
32-
OTLPSpanExporter = None # type: ignore[assignment,misc]
33-
_HAS_GRPC_EXPORTER = False
34-
25+
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
26+
OTLPSpanExporter,
27+
)
3528
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
3629
from opentelemetry.sdk.trace import TracerProvider
3730
from opentelemetry.sdk.trace.export import BatchSpanProcessor
@@ -45,21 +38,13 @@
4538

4639

4740
def _make_provider(otlp_endpoint: str) -> TracerProvider:
48-
assert OTLPSpanExporter is not None
4941
resource = Resource.create({SERVICE_NAME: "test-service"})
5042
exporter = OTLPSpanExporter(endpoint=otlp_endpoint, insecure=True)
5143
provider = TracerProvider(resource=resource)
5244
provider.add_span_processor(BatchSpanProcessor(exporter))
5345
return provider
5446

5547

56-
@unittest.skipUnless(
57-
_HAS_GRPC_EXPORTER,
58-
# grpcio has no pre-built wheels for some platforms (e.g. free-threaded Python on Windows)
59-
# skip these tests since they require the OTLP gRPC exporter to send telemetry to Weaver
60-
# but have nothing to do with the exporter implementation itself
61-
"opentelemetry-exporter-otlp-proto-grpc not installed",
62-
)
6348
@unittest.skipUnless(
6449
shutil.which("weaver") is not None,
6550
"weaver binary not found on PATH — install from https://github.com/open-telemetry/weaver/releases",

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ envlist =
9393
lint-opentelemetry-propagator-jaeger
9494

9595
py3{10,11,12,13,14,14t}-test-opentelemetry-test-utils
96+
; intentionally excluded from py314t on Windows (grpcio has no wheel for free-threaded Python)
9697
pypy3-test-opentelemetry-test-utils
9798
lint-opentelemetry-test-utils
9899

0 commit comments

Comments
 (0)