open-telemetry / open-telemetry/opentelemetry-java-instrumentation
Apply inline conditional assertion rule across tests
@trask is already working on this.
Since Sep 4, 2026.
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 1.2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 228
Description
Is your feature request related to a problem? Please describe.
Many tests hide mode-dependent expected span names and attribute values behind helper methods. Readers must leave the assertion to learn which values each mode expects. Updating all existing tests in the rule change would also conflict with several pull requests currently in flight.
Describe the solution you'd like
Apply the Java test rule for inline conditional expected values across the repository after the conflicting pull requests settle.
Keep short ternaries directly in assertions, including repeated span-name and attribute-value expectations. Preserve experimental(value) as the established exception, and keep helpers that perform nontrivial derivation from test data.
Remove redundant grouping parentheses around inlined ternaries.
Describe alternatives you've considered
Applying the cleanup in the rule pull request was considered, but the broad test changes would create avoidable conflicts with active pull requests.
Additional context
The instruction update is being submitted separately so new changes follow the convention before the repository-wide cleanup lands.
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.