You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Testing | General test patterns | Test files in scope — assertion style, test method signatures and throws clauses, resource cleanup, attribute assertions |`testing-general-patterns.md`|
29
29
| Testing | Experimental flag tests |`testExperimental`, experimental attribute assertions, `experimental` flags in JVM args or system properties |`testing-experimental-flags.md`|
30
+
| Testing | Flag-gated / mode-dependent assertion shape (experimental, `testLatestDeps`, semconv) — hoist flag into per-class constant, inline ternary, `if` for structural differences | Test classes branching on `EXPERIMENTAL_ATTRIBUTES`, `Boolean.getBoolean("testLatestDeps")`, or `emitOld*`/`emitStable*`|`testing-general-patterns.md`|
|`otel.semconv-stability.opt-in=…`|`emitStableDatabaseSemconv()`, `emitOldDatabaseSemconv()`, `emitStableCodeSemconv()`, etc. |`io.opentelemetry.instrumentation.api.internal.SemconvStability`|
170
+
|`otel.instrumentation.<module>.experimental-*`| per-module `EXPERIMENTAL_ATTRIBUTES` constant — see [testing-experimental-flags.md](testing-experimental-flags.md)| within the test class |
171
+
172
+
### Inline ternary in `equalTo(...)` with `null` for "absent"
173
+
174
+
Push the ternary as deep as possible — into the `equalTo` value or single attribute key —
175
+
rather than duplicating two whole `hasAttributesSatisfyingExactly(...)` blocks under a
176
+
`flag ? a : b`. The assertion API treats `null` as "expect attribute absent":
Copy file name to clipboardExpand all lines: instrumentation/apache-dubbo-2.7/library-autoconfigure/src/test/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/DubboHeadersGetterTest.java
Copy file name to clipboardExpand all lines: instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTest.java
Copy file name to clipboardExpand all lines: instrumentation/apache-dubbo-2.7/testing/src/main/java/io/opentelemetry/instrumentation/apachedubbo/v2_7/AbstractDubboTraceChainTest.java
Copy file name to clipboardExpand all lines: instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientTest.java
Copy file name to clipboardExpand all lines: instrumentation/armeria/armeria-1.3/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/armeria/v1_3/ArmeriaHttpServerTest.java
0 commit comments