@@ -209,108 +209,10 @@ jobs:
209
209
run : |
210
210
.\run-tests.ps1
211
211
212
- msi-without-wrappers-test :
213
- runs-on : ${{ matrix.OS }}
214
- needs : [msi-build]
215
- timeout-minutes : 15
216
- strategy :
217
- max-parallel : 1
218
- matrix :
219
- OS : [ "windows-2022" ]
220
- install-properties :
221
-
222
- - test : " default"
223
- install : " SPLUNK_ACCESS_TOKEN=fakeToken"
224
- expected : " -mode agent -access_token fakeToken -realm us0 -memory $null -with_fluentd false"
225
-
226
- - test : " gateway"
227
- install : " SPLUNK_SETUP_COLLECTOR_MODE=gateway SPLUNK_ACCESS_TOKEN=testing123"
228
- expected : " -mode gateway -access_token testing123 -realm us0 -memory $null -with_fluentd false"
229
-
230
- - test : " realm"
231
- install : " SPLUNK_REALM=myrealm SPLUNK_ACCESS_TOKEN=testing"
232
- expected : " -mode agent -access_token testing -realm myrealm -memory $null -with_fluentd false"
233
-
234
- - test : " ingest-url"
235
- install : " SPLUNK_INGEST_URL=https://fake.ingest.url SPLUNK_ACCESS_TOKEN=testing"
236
- expected : " -mode agent -realm us0 -access_token testing -ingest_url \" https://fake.ingest.url\" -memory $null -with_fluentd false"
237
-
238
- - test : " optional-params"
239
- install : " SPLUNK_ACCESS_TOKEN=fakeToken SPLUNK_MEMORY_TOTAL_MIB=256"
240
- expected : " -mode agent -access_token fakeToken -realm us0 -memory 256 -with_fluentd false"
241
-
242
- steps :
243
- - name : Check out the codebase.
244
- uses : actions/checkout@v4
245
-
246
- - name : Downloading msi build
247
- uses : actions/download-artifact@v4
248
- with :
249
- name : msi-build
250
- path : ./dist
251
-
252
- - name : Ensure required ports in the dynamic range are available
253
- run : |
254
- $ErrorActionPreference = 'Continue'
255
- & ${{ github.workspace }}\.github\workflows\scripts\win-required-ports.ps1
256
-
257
- - name : Install the collector
258
- run : |
259
- $ErrorActionPreference = 'Stop'
260
- $msi_path = Resolve-Path .\dist\splunk-otel-collector*.msi
261
- Test-Path $msi_path
262
- Write-Host "Installing $msi_path ..."
263
- $process = Start-Process -Wait -PassThru msiexec "/i `"$msi_path`" /qn /l*v msi-install.log ${{ matrix.install-properties.install }}"
264
- if ($process.ExitCode -ne 0) {
265
- throw "MSI installation failed with exit code $($process.ExitCode)"
266
- }
267
-
268
- - name : " In case of failure: display the install logs"
269
- if : ${{ failure() }}
270
- run : Get-Content msi-install.log
271
-
272
- - name : Start the collector service
273
- run : |
274
- $sc = Start-Service splunk-otel-collector -PassThru
275
- $sc.WaitForStatus('Running', '00:00:30')
276
-
277
- - name : Check registry expectations
278
- run : |
279
- $ErrorActionPreference = 'Stop'
280
- & ${{ github.workspace }}\.github\workflows\scripts\win-test-services.ps1 ${{ matrix.install-properties.expected }}
281
-
282
- - name : Stop the collector service
283
- run : |
284
- $sc = Stop-Service splunk-otel-collector -PassThru
285
- $sc.WaitForStatus('Stopped', '00:00:30')
286
-
287
- - name : " In case of failure: collect splunk-otel-collector events"
288
- if : ${{ failure() }}
289
- run : Get-WinEvent -ProviderName splunk-otel-collector | Sort-Object -Property TimeCreated | Select-Object -Property Message | Format-List
290
-
291
- - name : Uninstall the collector
292
- run : |
293
- $ErrorActionPreference = 'Stop'
294
- $uninstall_info = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\uninstall\* | Where { $_.DisplayName -eq "Splunk OpenTelemetry Collector" }
295
- Write-Host "Uninstalling $($uninstall_info.PSChildName) ..."
296
- $process = Start-Process -Wait -PassThru msiexec "/x $($uninstall_info.PSChildName) /qn /norestart"
297
- if ($process.ExitCode -ne 0) {
298
- throw "MSI installation failed with exit code $($process.ExitCode)"
299
- }
300
-
301
- - name : Check no leftover on the registry
302
- run : |
303
- $ErrorActionPreference = 'Stop'
304
- $uninstall_info = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\uninstall\* | Where { $_.DisplayName -eq "Splunk OpenTelemetry Collector" }
305
- if ($uninstall_info -ne $null) {
306
- throw "MSI uninstall failed"
307
- }
308
-
309
- msi-reinstall-test :
310
- runs-on : windows-2022
212
+ msi-test :
213
+ runs-on : otel-windows
311
214
needs : [msi-build]
312
- timeout-minutes : 15
313
-
215
+ timeout-minutes : 40
314
216
steps :
315
217
- name : Check out the codebase.
316
218
uses : actions/checkout@v4
@@ -321,88 +223,18 @@ jobs:
321
223
name : msi-build
322
224
path : ./dist
323
225
324
- - name : Ensure required ports in the dynamic range are available
325
- run : |
326
- $ErrorActionPreference = 'Continue'
327
- & ${{ github.workspace }}\.github\workflows\scripts\win-required-ports.ps1
328
-
329
- - name : Install the collector
226
+ - name : Set the MSI_COLLECTOR_PATH environment variable
330
227
run : |
331
228
$ErrorActionPreference = 'Stop'
332
229
$msi_path = Resolve-Path .\dist\splunk-otel-collector*.msi
333
230
Test-Path $msi_path
334
- Write-Host "Installing $msi_path ..."
335
- $process = Start-Process -Wait -PassThru msiexec "/i `"$msi_path`" /qn /l*v msi-install.log SPLUNK_ACCESS_TOKEN=1stInstall SPLUNK_REALM=1st"
336
- if ($process.ExitCode -ne 0) {
337
- throw "MSI installation failed with exit code $($process.ExitCode)"
338
- }
339
-
340
- - name : " In case of failure: display the install logs"
341
- if : ${{ failure() }}
342
- run : Get-Content msi-install.log
231
+ "MSI_COLLECTOR_PATH=$msi_path" | Out-File -FilePath $env:GITHUB_ENV -Append
343
232
344
- - name : Start the collector service
233
+ - name : Run the MSI tests
345
234
run : |
346
- $sc = Start-Service splunk-otel-collector -PassThru
347
- $sc.WaitForStatus('Running', '00:00:30')
235
+ go test -timeout 15m -v github.com/signalfx/splunk-otel-collector/tests/msi
348
236
349
- - name : " In case of failure: collect splunk-otel-collector events"
350
- if : ${{ failure() }}
351
- run : Get-WinEvent -ProviderName splunk-otel-collector | Sort-Object -Property TimeCreated | Select-Object -Property Message | Format-List
352
-
353
- - name : Check registry expectations
354
- run : |
355
- $ErrorActionPreference = 'Stop'
356
- & ${{ github.workspace }}\.github\workflows\scripts\win-test-services.ps1 -mode agent -realm 1st -access_token 1stInstall -memory $null -with_fluentd false
357
-
358
- - name : Reinstall the collector
359
- run : |
360
- $ErrorActionPreference = 'Stop'
361
- $msi_path = Resolve-Path .\dist\splunk-otel-collector*.msi
362
- Test-Path $msi_path
363
- Write-Host "Reinstalling $msi_path ..."
364
- $process = Start-Process -Wait -PassThru msiexec "/i `"$msi_path`" /qn /l*v msi-reinstall.log SPLUNK_ACCESS_TOKEN=2ndInstall SPLUNK_REALM=2nd SPLUNK_MEMORY_TOTAL_MIB=256 REINSTALL=SplunkCollectorConfiguration"
365
- if ($process.ExitCode -ne 0) {
366
- throw "MSI installation failed with exit code $($process.ExitCode)"
367
- }
368
-
369
- - name : " In case of failure: display the reinstall logs"
370
- if : ${{ failure() }}
371
- run : Get-Content msi-reinstall.log
372
-
373
- - name : Start the collector service after reinstall
374
- run : |
375
- $sc = Start-Service splunk-otel-collector -PassThru
376
- $sc.WaitForStatus('Running', '00:00:30')
377
-
378
- - name : Check registry expectations
379
- run : |
380
- $ErrorActionPreference = 'Stop'
381
- & ${{ github.workspace }}\.github\workflows\scripts\win-test-services.ps1 -mode agent -realm 2nd -access_token 2ndInstall -memory 256 -with_fluentd false
382
-
383
- - name : " In case of failure: collect splunk-otel-collector events"
384
- if : ${{ failure() }}
385
- run : Get-WinEvent -ProviderName splunk-otel-collector | Sort-Object -Property TimeCreated | Select-Object -Property Message | Format-List
386
-
387
- - name : Uninstall the collector
388
- run : |
389
- $ErrorActionPreference = 'Stop'
390
- $uninstall_info = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\uninstall\* | Where { $_.DisplayName -eq "Splunk OpenTelemetry Collector" }
391
- Write-Host "Uninstalling $($uninstall_info.PSChildName) ..."
392
- $process = Start-Process -Wait -PassThru msiexec "/x $($uninstall_info.PSChildName) /qn /norestart"
393
- if ($process.ExitCode -ne 0) {
394
- throw "MSI installation failed with exit code $($process.ExitCode)"
395
- }
396
-
397
- - name : Check no leftover on the registry
398
- run : |
399
- $ErrorActionPreference = 'Stop'
400
- $uninstall_info = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\uninstall\* | Where { $_.DisplayName -eq "Splunk OpenTelemetry Collector" }
401
- if ($uninstall_info -ne $null) {
402
- throw "MSI uninstall failed"
403
- }
404
-
405
- msi-test :
237
+ windows-install-script-test :
406
238
runs-on : ${{ matrix.OS }}
407
239
needs : [msi-build]
408
240
strategy :
0 commit comments