Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use --develop flag for agent install e2e tests #4403

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When backporting this PR we will need to remove this change

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"
Loading