Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

sdk-testing assertj failure messages report the wrong value or type

已关闭 适合新手
#8,866 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java
领域
testing

调研方向

从 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() and ExponentialHistogramAssert.isDelta() pass the expected constant as an extra format argument, so %s prints the expected value instead of the actual one.
  • HistogramAssert.isDelta() also says "Histgram ... cumulative", and ExponentialHistogramAssert.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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

open-telemetry/opentelemetry-java 的其他 Issue

查看 open-telemetry/opentelemetry-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。