[9.3](backport #6612) [OpAMP] Add TestOpAMPWithEDOTCollector E2E test#6664
Merged
ycombinator merged 4 commits into9.3from Mar 26, 2026
Merged
[9.3](backport #6612) [OpAMP] Add TestOpAMPWithEDOTCollector E2E test#6664ycombinator merged 4 commits into9.3from
TestOpAMPWithEDOTCollector E2E test#6664ycombinator merged 4 commits into9.3from
Conversation
* test(e2e): add EDOT Collector OpAMP E2E test - Add TestEDOTOpAMP to verify that the EDOT Collector bundled inside the Elastic Agent package can connect to Fleet Server over OpAMP and enroll in .fleet-agents - Extract shared agent download/extract helpers (downloadElasticAgent, extractAgentArchive) into agent_download.go, refactoring the duplicated code from AgentInstallSuite - Fix TestOpAMP: pre-create the bin/ directory before running make otelcontribcol, which requires it to exist Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * e2e: add TestOpAMPWithEDOTCollector and refactor shared OpAMP setup - Extract shared download/extract helpers into agent_download.go with caching (sha512 comparison), FileReplacer, ExtractFilter, and correct chmod after extraction - Extract startFleetServerForOpAMP and writeOpAMPCollectorConfig helpers shared by both OpAMP tests - Rename TestOpAMP → TestOpAMPWithUpstreamCollector - Add TestOpAMPWithEDOTCollector: downloads elastic-agent package, runs elastic-agent otel subcommand, verifies EDOT Collector enrolls in Fleet Server over OpAMP Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore(e2e): clean up OpAMP test comments and simplify writeOpAMPCollectorConfig Update inline comments, simplify writeOpAMPCollectorConfig to take a single configFilePath parameter, and add newlines after Require() statements for readability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore(e2e): improve EDOT test readability Elaborate on the processExited comment and move the Cleanup block below the early-exit check so the flow reads top-to-bottom. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore(e2e): fix stale comments in EDOT test Rename "immediate exit" to "early exit" for consistency and update the Cleanup comment now that it is registered after the early-exit check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(e2e): extract standalone extractTar/extractZip into agent_download.go Move archive extraction out of AgentInstallSuite into standalone functions so both AgentInstallSuite and StandAloneSuite can reuse them. AgentInstallSuite now overwrites the fleet-server binary after extraction instead of during. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(e2e): remove implicit parent directory creation in extractTar/extractZip Remove MkdirAll(filepath.Dir(path)) calls for regular files and symlinks so that missing directory entries in archives surface as test failures rather than being silently papered over (ref: PR #4985). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(e2e): replace static instance UIDs with generated UUIDv7s Use uuid.Must(uuid.NewV7()) instead of hardcoded UUIDs for OpAMP test instance UIDs, as suggested in review. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> (cherry picked from commit 5ece964) # Conflicts: # testing/e2e/stand_alone_test.go
Contributor
Author
|
Cherry-pick of 5ece964 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
ycombinator
previously approved these changes
Mar 25, 2026
The assertions for agent.type, agent.version, tags, and policy_revision_idx depend on the field mapping logic from #6400 which has not been backported to 9.3 yet. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ycombinator
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TestOpAMPWithEDOTCollector, an E2E test that downloads the Elastic Agent package, extracts the EDOT Collector binary, runs it viaelastic-agent otel, and verifies it enrolls with Fleet Server over OpAMPstartFleetServerForOpAMPandwriteOpAMPCollectorConfighelpers, used by bothTestOpAMPWithUpstreamCollectorandTestOpAMPWithEDOTCollectorextractTarandextractZipfromAgentInstallSuiteinto standalone functions inagent_download.goso bothAgentInstallSuiteandStandAloneSuitecan reuse themResolves #6394
🤖 Generated with Claude Code
This is an automatic backport of pull request #6612 done by Mergify.