Skip to content

Commit

Permalink
Use --develop flag for agent install e2e tests (#4403)
Browse files Browse the repository at this point in the history
* Use --develop flag for agent install e2e tests

* Update testing stack version to 9.1.0-SNAPSHOT

(cherry picked from commit 23bd61a)
  • Loading branch information
michel-laterman authored and mergify[bot] committed Feb 4, 2025
1 parent 9c57ff4 commit 5b2cad8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dev-tools/e2e/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ xpack.fleet.agentPolicies:
namespace: default
package_policies:
- name: fleet_server-2
id: default-fleet-server
id: apm-fleet-server
package:
name: fleet_server
xpack.fleet.outputs:
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/integration/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# If you use change this version without a pinned one, please update
# .ci/bump-elastic-stack-snapshot.yml or .github/workflows/bump-golang.yml
ELASTICSEARCH_VERSION=9.0.0-a38910c2-SNAPSHOT
ELASTICSEARCH_VERSION=9.1.0-ae17f1a1-SNAPSHOT
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=changeme
TEST_ELASTICSEARCH_HOSTS=localhost:9200
Expand Down
10 changes: 7 additions & 3 deletions testing/e2e/agent_install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (suite *AgentInstallSuite) SetupSuite() {
return
}
// check if agent is installed
if _, err := exec.LookPath(agentName); err == nil {
if _, err := exec.LookPath(agentDevName); err == nil {
suite.installDetected = true
return // don't bother with setup, skip all tests
}
Expand Down Expand Up @@ -277,15 +277,16 @@ func (suite *AgentInstallSuite) TearDownTest() {
return
}

out, err := exec.Command("sudo", "elastic-agent", "uninstall", "--force").CombinedOutput()
suite.Assert().NoErrorf(err, "elastic-agent uninstall failed. Output: %s", out)
out, err := exec.Command("sudo", "elastic-development-agent", "uninstall", "--force").CombinedOutput()
suite.Assert().NoErrorf(err, "elastic-development-agent uninstall failed. Output: %s", out)
}

func (suite *AgentInstallSuite) TestHTTP() {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute*3)
defer cancel()

cmd := exec.CommandContext(ctx, "sudo", suite.agentPath, "install",
"--develop", "--install-servers",
"--fleet-server-es=http://"+suite.ESHosts,
"--fleet-server-service-token="+suite.ServiceToken,
"--fleet-server-insecure-http=true",
Expand All @@ -310,6 +311,7 @@ func (suite *AgentInstallSuite) TestWithSecretFiles() {
defer cancel()

cmd := exec.CommandContext(ctx, "sudo", suite.agentPath, "install",
"--develop", "--install-servers",
"--url=https://localhost:8220",
"--certificate-authorities="+filepath.Join(suite.CertPath, "e2e-test-ca.crt"),
"--fleet-server-es=http://"+suite.ESHosts,
Expand Down Expand Up @@ -365,6 +367,7 @@ func (suite *AgentInstallSuite) TestAPMInstrumentationFile() {
defer cancel()

cmd := exec.CommandContext(ctx, "sudo", suite.agentPath, "install",
"--develop", "--install-servers",
"--fleet-server-es=http://"+suite.ESHosts,
"--fleet-server-service-token="+suite.ServiceToken,
"--fleet-server-insecure-http=true",
Expand Down Expand Up @@ -403,6 +406,7 @@ func (suite *AgentInstallSuite) TestAPMInstrumentationPolicy() {
})

cmd := exec.CommandContext(ctx, "sudo", suite.agentPath, "install",
"--develop", "--install-servers",
"--fleet-server-es=http://"+suite.ESHosts,
"--fleet-server-service-token="+suite.ServiceToken,
"--fleet-server-insecure-http=true",
Expand Down
5 changes: 3 additions & 2 deletions testing/e2e/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

package e2e

const binaryName = "fleet-server" //nolint:unused // work around to get platform specific binary name for tests
const agentName = "elastic-agent" //nolint:unused // work around to get platform specific binary name for tests
const binaryName = "fleet-server" //nolint:unused // work around to get platform specific binary name for tests
const agentName = "elastic-agent" //nolint:unused // work around to get platform specific binary name for tests
const agentDevName = "elastic-development-agent" //nolint:unused // work around to get platform specific binary name for tests
1 change: 1 addition & 0 deletions testing/e2e/const_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ package e2e

const binaryName = "fleet-server.exe"
const agentName = "elastic-agent.exe"
const agentDevName = "elastic-development-agent.exe"

0 comments on commit 5b2cad8

Please sign in to comment.