Skip to content

e2e: add TestOpAMPWithEDOTCollector#6612

Draft
ycombinator wants to merge 10 commits intoelastic:mainfrom
ycombinator:e2e-edot-opamp-test
Draft

e2e: add TestOpAMPWithEDOTCollector#6612
ycombinator wants to merge 10 commits intoelastic:mainfrom
ycombinator:e2e-edot-opamp-test

Conversation

@ycombinator
Copy link
Contributor

⚠️ This PR currently contains commits from #6611 and will be rebased on main once that PR has been merged.

Summary

  • Adds TestOpAMPWithEDOTCollector, an E2E test that downloads the Elastic Agent package, extracts the EDOT Collector binary, runs it via elastic-agent otel, and verifies it enrolls with Fleet Server over OpAMP
  • Refactors shared OpAMP test setup into startFleetServerForOpAMP and writeOpAMPCollectorConfig helpers, used by both TestOpAMPWithUpstreamCollector and TestOpAMPWithEDOTCollector

Resolves #6394

🤖 Generated with Claude Code

ycombinator and others added 6 commits March 18, 2026 09:15
…uite

Extract downloadElasticAgent, extractAgentArchive (and internal tar/zip
helpers) into a new agent_download.go file so they can be reused by other
E2E tests without duplication.

Improvements over the original inline methods:
- Caching: the downloaded archive is stored in os.UserCacheDir() and
  reused on subsequent runs if the remote .sha512 checksum matches,
  avoiding repeated 600 MB downloads
- ExtractFilter callback: lets callers limit which entries are written to
  disk (complementing the existing FileReplacer)
- Explicit chmod after extraction: ensures execute bits are preserved
  regardless of the process umask

AgentInstallSuite is updated to call the shared helpers; behaviour is
unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e methods

Replace the FileReplacer callback with the original extractZip/extractTar/copyFleetServer
suite methods on AgentInstallSuite, matching the pre-refactor approach. The shared
downloadElasticAgent function (with caching) remains in agent_download.go.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t cache

Avoids persistent cache growth in ~/Library/Caches (macOS) or ~/.cache (Linux).
TempDir is cleared on reboot and is appropriate for CI/test artifacts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mergify
Copy link
Contributor

mergify bot commented Mar 18, 2026

This pull request does not have a backport label. Could you fix it @ycombinator? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@mergify
Copy link
Contributor

mergify bot commented Mar 18, 2026

This pull request is now in conflicts. Could you fix it @ycombinator? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b e2e-edot-opamp-test upstream/e2e-edot-opamp-test
git merge upstream/main
git push upstream e2e-edot-opamp-test

ycombinator and others added 4 commits March 18, 2026 10:10
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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>
- 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>
@ycombinator ycombinator force-pushed the e2e-edot-opamp-test branch from b90f730 to 26d94f5 Compare March 18, 2026 17:11
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.

[OpAMP][E2E Test] Verify that EDOT Collectors can talk to Fleet over OpAMP

2 participants