sdk-testing assertj failure messages report the wrong value or type
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 sdk/testing/src/main/java/io/opentelemetry/sdk/testing/assertj/ 开始,检查 HistogramAssert、ExponentialHistogramAssert、MetricAssert 和 LogRecordDataAssert,并以 LongSumAssert.isCumulative() 作为比较点。修正 issue 中描述的报告值、格式参数和措辞,然后运行 sdk-testing 测试,并验证失败消息是否与预期文本一致。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
Some opentelemetry-sdk-testing assertj failure messages report the wrong value or the wrong field. The pass/fail result is correct, but the message can mislead whoever reads the failing test log.
Steps to reproduce
Call assertThat(metric).hasHistogramSatisfying(h -> h.isCumulative()) on a metric whose histogram uses DELTA temporality.
What did you expect to see?
Expected Histogram to have cumulative aggregation but found <DELTA>, the same shape LongSumAssert.isCumulative() produces.
What did you see instead?
Expected Histogram to have cumulative aggregation but found <CUMULATIVE>. Five places under sdk/testing/src/main/java/io/opentelemetry/sdk/testing/assertj/ are affected:
HistogramAssert.isCumulative(),isDelta()andExponentialHistogramAssert.isDelta()pass the expected constant as an extra format argument, so%sprints the expected value instead of the actual one.HistogramAssert.isDelta()also says "Histgram ... cumulative", andExponentialHistogramAssert.isDelta()says "cumulative".MetricAssert.hasInstrumentationScope()says "to have resource".LogRecordDataAssert.hasSpanContext()says "span context <...> nanos".
What version and what artifacts are you using?
Artifacts: opentelemetry-sdk-testing
Version: main @ ce32c1205
How did you reference these artifacts? N/A (repository source)
Environment
Compiler: Temurin 21
OS: N/A
Additional context
N/A
- 主要语言
- Java
- 星标
- 2.5k
- 派生
- 1k
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 74
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
open-telemetry/opentelemetry-java 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 94/100
open-telemetry/opentelemetry-java#8898 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
open-telemetry/opentelemetry-java#8896 ·
维护者通常 2 天内回复
-
难度 1/5 1 小时以内 新手友好度 94/100
open-telemetry/opentelemetry-java#8886 ·
维护者通常 2 天内回复
-
ComposableProbabilitySampler description still uses the old ComposableTraceIdRatioBasedSampler name未关闭
难度 1/5 1 小时以内 新手友好度 88/100
open-telemetry/opentelemetry-java#8885 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
open-telemetry/opentelemetry-java#8884 ·
维护者通常 2 天内回复
查看 open-telemetry/opentelemetry-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
apache/arrow-java#1311 ·
维护者通常 2 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
security
难度 2/5 1-3 小时 新手友好度 65/100
IBM/networking-java-sdk#204 ·