Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#8,866 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
testing

Hướng nghiên cứu

Bắt đầu trong sdk/testing/src/main/java/io/opentelemetry/sdk/testing/assertj/ và kiểm tra HistogramAssert, ExponentialHistogramAssert, MetricAssert và LogRecordDataAssert, sử dụng LongSumAssert.isCumulative() làm điểm so sánh. Sửa các giá trị được báo cáo, các đối số định dạng và cách diễn đạt được mô tả trong issue, sau đó chạy các bài kiểm tra sdk-testing và xác minh rằng các thông báo lỗi khớp với văn bản mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Java
Star
2.5k
Fork
1k
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
64

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của open-telemetry/opentelemetry-java

Tất cả issue của open-telemetry/opentelemetry-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.