Skip to content

[chore] [cmd/mdatagen] Fix Windows CI test failures due to missing scraperhelper dependency - #15286

Merged
dmitryax merged 1 commit into
open-telemetry:mainfrom
jkoronaAtCisco:loader_test_fix
May 26, 2026
Merged

[chore] [cmd/mdatagen] Fix Windows CI test failures due to missing scraperhelper dependency#15286
dmitryax merged 1 commit into
open-telemetry:mainfrom
jkoronaAtCisco:loader_test_fix

Conversation

@jkoronaAtCisco

Copy link
Copy Markdown
Member

Description

The TestLoader_LoadFromHTTP_Success/NotFound/ServerError tests in internal/schemagen were failing on all Windows CI runners with:

  failed to run `go get` for module go.opentelemetry.io/collector/scraper/scraperhelper: exit status 1                                                                                             

The root cause: loadFromHTTP calls refVersion, which uses packages.Load to resolve the module version of go.opentelemetry.io/collector/scraper/scraperhelper. Because scraperhelper was not listed in internal/schemagen/go.mod, packages.Load returned nothing on fresh Windows CI environments where the module was not in the cache. The code then fell back to go get, which failed (network restrictions / inability to modify the module on CI).

The fix adds scraperhelper as an explicit dependency of internal/schemagen and adds a blank import in loader_test.go so go mod tidy retains the entry.

Link to tracking issue

Fixes #15285

@jkoronaAtCisco
jkoronaAtCisco requested a review from a team as a code owner May 11, 2026 15:06
@jkoronaAtCisco jkoronaAtCisco changed the title [chore] [mdatagen] Fix Windows CI test failures due to missing scraperhelper dependency [chore] [cmd/mdatagen] Fix Windows CI test failures due to missing scraperhelper dependency May 11, 2026
@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.24%. Comparing base (d3b2c86) to head (4882f55).
⚠️ Report is 43 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15286      +/-   ##
==========================================
- Coverage   91.25%   91.24%   -0.02%     
==========================================
  Files         705      705              
  Lines       46082    46082              
==========================================
- Hits        42054    42046       -8     
- Misses       2822     2828       +6     
- Partials     1206     1208       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@codspeed-hq

codspeed-hq Bot commented May 11, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 7 untouched benchmarks
⏩ 76 skipped benchmarks1


Comparing jkoronaAtCisco:loader_test_fix (4882f55) with main (d3b2c86)

Open in CodSpeed

Footnotes

  1. 76 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codeboten codeboten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a rebase

@dmitryax dmitryax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mdatagenDir(t) returns filepath.Join(filepath.Dir(file), "../.."), which from internal/schemagen/ resolves to the repo root. So the go get is called from the root. If I understand that correctly, this fix won't help.

Comment thread internal/schemagen/go.mod Outdated

replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile

replace go.opentelemetry.io/collector/consumer => ../../consumer

@dmitryax dmitryax May 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not add new go dependency with all these replaces to make tests happy. The tests should be updated instead.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I updated the tests instead: replaced mdatagenDir(t) with a schemagenDir(t) helper that returns internal/schemagen/ itself, and switched the ref module from scraperhelper to confmap (a direct dep
with a local replace). packages.Load resolves the version immediately from there, so the go get fallback is never reached. No go.mod or go.sum changes needed.

@dmitryax
dmitryax added this pull request to the merge queue May 26, 2026
Merged via the queue into open-telemetry:main with commit a17ec5a May 26, 2026
66 checks passed
raghu999 pushed a commit to raghu999/opentelemetry-collector that referenced this pull request Aug 6, 2026
…raperhelper dependency (open-telemetry#15286)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

The TestLoader_LoadFromHTTP_Success/NotFound/ServerError tests in
internal/schemagen were failing on all Windows CI runners with:
```
  failed to run `go get` for module go.opentelemetry.io/collector/scraper/scraperhelper: exit status 1                                                                                             
```
The root cause: loadFromHTTP calls refVersion, which uses packages.Load
to resolve the module version of
`go.opentelemetry.io/collector/scraper/scraperhelper`. Because
scraperhelper was not listed in `internal/schemagen/go.mod`,
packages.Load returned nothing on fresh Windows CI environments where
the module was not in the cache. The code then fell back to `go get`,
which failed (network restrictions / inability to modify the module on
CI).

The fix adds scraperhelper as an explicit dependency of
internal/schemagen and adds a blank import in loader_test.go so go mod
tidy retains the entry.

<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes open-telemetry#15285
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.

[schemagen] Test failures in loader_test.go

4 participants