Commit 9fd5ba8
* [OpAMP] Add `TestOpAMPWithEDOTCollector` E2E test (#6612)
* 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
* Fixing conflicts
---------
Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
1 parent 940acd8 commit 9fd5ba8
File tree
3 files changed
+307
-140
lines changed- testing/e2e
3 files changed
+307
-140
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| |||
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
193 | 323 | | |
194 | 324 | | |
195 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 10 | | |
15 | | - | |
16 | 11 | | |
17 | 12 | | |
18 | 13 | | |
19 | 14 | | |
20 | 15 | | |
21 | 16 | | |
22 | 17 | | |
23 | | - | |
24 | 18 | | |
25 | 19 | | |
26 | 20 | | |
| |||
86 | 80 | | |
87 | 81 | | |
88 | 82 | | |
| 83 | + | |
89 | 84 | | |
90 | 85 | | |
91 | | - | |
| 86 | + | |
92 | 87 | | |
93 | | - | |
| 88 | + | |
94 | 89 | | |
95 | 90 | | |
96 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 106 | + | |
111 | 107 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 108 | + | |
144 | 109 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 110 | + | |
151 | 111 | | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | 112 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | 113 | | |
199 | 114 | | |
| 115 | + | |
200 | 116 | | |
201 | 117 | | |
202 | | - | |
203 | | - | |
204 | 118 | | |
205 | 119 | | |
206 | 120 | | |
| |||
0 commit comments