e2e: add TestOpAMPWithEDOTCollector#6612
Draft
ycombinator wants to merge 10 commits intoelastic:mainfrom
Draft
Conversation
…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>
Contributor
|
This pull request does not have a backport label. Could you fix it @ycombinator? 🙏
|
Contributor
|
This pull request is now in conflicts. Could you fix it @ycombinator? 🙏 |
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>
b90f730 to
26d94f5
Compare
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 bothTestOpAMPWithUpstreamCollectorandTestOpAMPWithEDOTCollectorResolves #6394
🤖 Generated with Claude Code