Skip to content

Commit

Permalink
Resolve the expansion bug (#5267)
Browse files Browse the repository at this point in the history
* Resolve the expansion bug

* use new config for upgrade tests

* Fix TestConfigYamlEnvVar

---------

Co-authored-by: jeffreyc-splunk <jeffreyc@splunk.com>
  • Loading branch information
dmitryax and jeffreyc-splunk authored Aug 20, 2024
1 parent e587f61 commit bdfa0fb
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 682 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/win-package-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ jobs:
if ($LASTEXITCODE -ne 0) {
throw "choco install failed!"
}
stop-service splunk-otel-collector
rm "$env:PROGRAMDATA\Splunk\OpenTelemetry Collector\*_config.yaml"
Start-Sleep 30
write-host "Upgrading $choco_file_name ..."
choco upgrade splunk-otel-collector -s=".\dist" -y
Expand Down
12 changes: 3 additions & 9 deletions internal/buildscripts/packaging/tests/package_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,23 +197,20 @@ def test_collector_package_upgrade(distro, arch):
# install an older version of the collector package
run_container_cmd(container, install_cmd, env={"VERIFY_ACCESS_TOKEN": "false"}, timeout="10m")

time.sleep(5)
time.sleep(10)

# verify collector service status
assert wait_for(lambda: service_is_running(container, service_owner=SERVICE_OWNER))

# change the config
run_container_cmd(container, f"sh -c 'echo \"# This line should be preserved\" >> {AGENT_CONFIG_PATH}'")

copy_file_into_container(container, pkg_path, f"/test/{pkg_base}")

# upgrade package
if distro in DEB_DISTROS:
run_container_cmd(container, f"dpkg -i --force-confold /test/{pkg_base}")
run_container_cmd(container, f"dpkg -i --force-confnew /test/{pkg_base}")
elif distro in RPM_DISTROS:
run_container_cmd(container, f"rpm -U /test/{pkg_base}")

time.sleep(5)
time.sleep(10)

run_container_cmd(container, f"test -d {BUNDLE_DIR}")
run_container_cmd(container, f"test -d {BUNDLE_DIR}/run/collectd")
Expand All @@ -224,8 +221,5 @@ def test_collector_package_upgrade(distro, arch):
# verify collector service status
assert wait_for(lambda: service_is_running(container, service_owner=SERVICE_OWNER))

# verify changed config was preserved after upgrade
run_container_cmd(container, f"grep '# This line should be preserved' {AGENT_CONFIG_PATH}")

finally:
run_container_cmd(container, f"journalctl -u {SERVICE_NAME} --no-pager")
74 changes: 0 additions & 74 deletions internal/configconverter/k8s_tagger.go

This file was deleted.

51 changes: 0 additions & 51 deletions internal/configconverter/k8s_tagger_test.go

This file was deleted.

91 changes: 0 additions & 91 deletions internal/configconverter/loglevel_to_verbosity.go

This file was deleted.

38 changes: 0 additions & 38 deletions internal/configconverter/loglevel_to_verbosity_test.go

This file was deleted.

57 changes: 0 additions & 57 deletions internal/configconverter/move_hec_tls.go

This file was deleted.

Loading

0 comments on commit bdfa0fb

Please sign in to comment.