Skip to content

Strengthen graal incubating-not-found test to detect incubator API on classpath#8510

Draft
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:test/graal-incubating-not-found-assertion
Draft

Strengthen graal incubating-not-found test to detect incubator API on classpath#8510
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:test/graal-incubating-not-found-assertion

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8509

Description

  • incubatingApiIsNotFoundViaReflection() asserted isInstanceOf(Logger/Tracer/LongCounterBuilder.class) on the noop instances. The incubator Extended* noops subtype those stable types, so the assertions hold even when an incubator noop is returned — the test never checks what its name claims.
  • Assert instead that the noop runtime class is not under io.opentelemetry.api.incubator.*, which fails if :api:incubator is wrongly added to this module (the regression it guards). A package-name check is used because the module does not depend on :api:incubator and cannot reference the Extended* types directly.
  • Mirrors the sibling graal-incubating IncubatingApiTests.incubatingApiIsLoadedViaReflection(), which asserts the Extended* subtypes are present. The file was added by don't throw class cast exception when we have a noop tracer, meter, logger #6617 as the no-CCE safety net.

Testing done

  • The test has no @EnabledInNativeImage, so it runs on the regular JVM test task, not native-CI-only.
  • ./gradlew :integration-tests:graal:check — passed (test + spotlessCheck + checkstyle).
  • No CHANGELOG/apidiff: test-only change in a non-published module, no behavior or API change.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.77%. Comparing base (824334c) to head (9e4a418).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8510   +/-   ##
=========================================
  Coverage     78.77%   78.77%           
  Complexity     8579     8579           
=========================================
  Files          1009     1009           
  Lines         28993    28993           
  Branches       3599     3599           
=========================================
  Hits          22839    22839           
  Misses         5311     5311           
  Partials        843      843           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

graal IncubatingNotFoundApiTests assertion does not detect incubator API on classpath

1 participant