opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

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

Open thswlsqls opened this issue 5 months ago • 1 comments

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 open-telemetry/opentelemetry-java#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.

thswlsqls avatar Jun 22 '26 08:06 thswlsqls

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 78.77%. Comparing base (824334c) to head (9e4a418). :warning: Report is 70 commits behind head on main.

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           

:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Jun 22 '26 08:06 codecov[bot]

This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

github-actions[bot] avatar Jul 09 '26 18:07 github-actions[bot]

Thank you for your contribution @thswlsqls! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

otelbot[bot] avatar Jul 13 '26 20:07 otelbot[bot]