Skip to content

[TEST] Add Windows max macro regression test for OTLP public headers#3865

Draft
ThomsonTan wants to merge 2 commits intoopen-telemetry:mainfrom
ThomsonTan:test_min_max_regression_for_windows
Draft

[TEST] Add Windows max macro regression test for OTLP public headers#3865
ThomsonTan wants to merge 2 commits intoopen-telemetry:mainfrom
ThomsonTan:test_min_max_regression_for_windows

Conversation

@ThomsonTan
Copy link
Contributor

Follow up for the comment #3861 (comment)

Changes

  • Adds a new regression test in otlp_windows_max_macro_compile_test.cc that defines a Windows-style max macro before including OTLP public headers.
  • Prevents recurrence of the Windows/MSVC include-order failure reported in issue v1.25 regression: Build break on Windows with Visual Studio 2022 #3861; no runtime behavior changes, test-only coverage improvement.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.99%. Comparing base (717cfc9) to head (9f66370).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3865   +/-   ##
=======================================
  Coverage   89.99%   89.99%           
=======================================
  Files         225      225           
  Lines        7170     7170           
=======================================
  Hits         6452     6452           
  Misses        718      718           

see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcalff
Copy link
Member

@ThomsonTan

What this new test will do, is prevent similar bugs to be introduced again in otlp_http_exporter_options.h.

It will not prevent another similar bug to appear in another header file.

Suggestion: implement a new CI check script, similar to tools/check_copyright.sh, that looks for known dangerous coding pattern.

A script running grep -w "max(" on all the source code will pick up the next break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants