From f2e5de831d221ecfc39cda2744796b0b01e3c907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 17:59:09 +0100 Subject: [PATCH 01/10] chore: use nightly annotation for the Upgrade tests --- e2e/_suites/fleet/features/fleet_mode_agent.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/_suites/fleet/features/fleet_mode_agent.feature b/e2e/_suites/fleet/features/fleet_mode_agent.feature index edc457fd9c..2af294f985 100644 --- a/e2e/_suites/fleet/features/fleet_mode_agent.feature +++ b/e2e/_suites/fleet/features/fleet_mode_agent.feature @@ -40,7 +40,7 @@ Examples: | debian | # @upgrade-agent -@skip +@nightly Scenario Outline: Upgrading the installed agent Given a "" agent "stale" is deployed to Fleet with "tar" installer And certs for "" are installed From 616ca2c45b47573e142ace67cdf5454261c5b291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 18:02:52 +0100 Subject: [PATCH 02/10] chore: add two make goals for the nightly use cases - e2e-fleet-nightly: run the nightly tests not using CI snapshots. It should download the binaries from the official artifactory. - e2e-fleet-nightly-ci-snapshots: run the nightly tests using the CI snapshots for a specific SHA commit from Beats, downloading them from a GCP bucket --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index d761f57f4c..c848c15b56 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,14 @@ clean-docker: clean-workspace: rm -fr ~/.op/compose +.PHONY: e2e-fleet-nightly +e2e-fleet-nightly: + SUITE="fleet" TAGS="fleet_mode_agent && nightly" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE DEVELOPER_MODE=true $(MAKE) -C e2e functional-test + +.PHONY: e2e-fleet-nightly-ci-snapshots +e2e-fleet-nightly-ci-snapshots: + SUITE="fleet" TAGS="fleet_mode_agent && nightly" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true GITHUB_CHECK_SHA1=a1962c8864016010adcde9f35bd8378debb4fbf7 $(MAKE) -C e2e functional-test + .PHONY: install install: go get -v -t ./... From 5d13bff0ee17dbf1ae0a460eb3122d5ab39d83c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 18:03:48 +0100 Subject: [PATCH 03/10] chore: bump elastic-agent stale version --- .ci/Jenkinsfile | 2 +- e2e/_suites/fleet/ingest-manager_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 10018efeb7..75eb3c764f 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -35,7 +35,7 @@ pipeline { string(name: 'SLACK_CHANNEL', defaultValue: 'observablt-bots', description: 'The Slack channel(s) where errors will be posted. For multiple channels, use a comma-separated list of channels') string(name: 'ELASTIC_AGENT_DOWNLOAD_URL', defaultValue: '', description: 'If present, it will override the download URL for the Elastic agent artifact. (I.e. https://snapshots.elastic.co/8.0.0-59098054/downloads/beats/elastic-agent/elastic-agent-8.0.0-SNAPSHOT-linux-x86_64.tar.gz') string(name: 'ELASTIC_AGENT_VERSION', defaultValue: '8.0.0-SNAPSHOT', description: 'SemVer version of the stand-alone elastic-agent to be used for Fleet tests. You can use here the tag of your PR to test your changes') - string(name: 'ELASTIC_AGENT_STALE_VERSION', defaultValue: '7.10.1', description: 'SemVer version of the stale stand-alone elastic-agent to be used for Fleet upgrade tests.') + string(name: 'ELASTIC_AGENT_STALE_VERSION', defaultValue: '7.10.2', description: 'SemVer version of the stale stand-alone elastic-agent to be used for Fleet upgrade tests.') booleanParam(name: "BEATS_USE_CI_SNAPSHOTS", defaultValue: false, description: "If it's needed to use the binary snapshots produced by Beats CI instead of the official releases") choice(name: 'LOG_LEVEL', choices: ['DEBUG', 'INFO'], description: 'Log level to be used') choice(name: 'TIMEOUT_FACTOR', choices: ['5', '3', '7', '11'], description: 'Max number of minutes for timeout backoff strategies') diff --git a/e2e/_suites/fleet/ingest-manager_test.go b/e2e/_suites/fleet/ingest-manager_test.go index 4ad2c93612..6c82f704dc 100644 --- a/e2e/_suites/fleet/ingest-manager_test.go +++ b/e2e/_suites/fleet/ingest-manager_test.go @@ -45,7 +45,7 @@ var agentVersion = agentVersionBase // agentStaleVersion is the version of the agent to use as a base during upgrade // It can be overriden by ELASTIC_AGENT_STALE_VERSION env var. Using latest GA as a default. -var agentStaleVersion = "7.10.0" +var agentStaleVersion = "7.10.2" // stackVersion is the version of the stack to use // It can be overriden by STACK_VERSION env var From 5403a8d305d5900f2c161543f1403a90a8276a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 18:09:22 +0100 Subject: [PATCH 04/10] chore: pass version and state state when creating an installer This will allow selecting the proper binary, depending if we are using a stale agent or a regular one. --- e2e/_suites/fleet/fleet.go | 9 +- e2e/_suites/fleet/ingest-manager_test.go | 8 +- e2e/_suites/fleet/installers.go | 7 + e2e/_suites/fleet/services.go | 43 +++--- e2e/_suites/fleet/services_test.go | 174 +++++++++++++++++++++-- 5 files changed, 200 insertions(+), 41 deletions(-) diff --git a/e2e/_suites/fleet/fleet.go b/e2e/_suites/fleet/fleet.go index 1140a91f1b..e6b412fa2a 100644 --- a/e2e/_suites/fleet/fleet.go +++ b/e2e/_suites/fleet/fleet.go @@ -163,10 +163,9 @@ func (fts *FleetTestSuite) anStaleAgentIsDeployedToFleetWithInstaller(image, ver agentVersion = version // prepare installer for stale version - if agentVersion != agentVersionBackup { - i := GetElasticAgentInstaller(image, installerType) - installerType = fmt.Sprintf("%s-%s", installerType, version) - fts.Installers[fmt.Sprintf("%s-%s", image, installerType)] = i + if fts.Version != agentVersionBackup { + i := GetElasticAgentInstaller(image, installerType, fts.Version, true) + fts.Installers[fmt.Sprintf("%s-%s-%s", image, installerType, version)] = i } return fts.anAgentIsDeployedToFleetWithInstaller(image, installerType) @@ -291,7 +290,7 @@ func (fts *FleetTestSuite) anAgentIsDeployedToFleetWithInstaller(image string, i } func (fts *FleetTestSuite) getInstaller() ElasticAgentInstaller { - return fts.Installers[fts.Image+"-"+fts.InstallerType] + return fts.Installers[fts.Image+"-"+fts.InstallerType+"-"+fts.Version] } func (fts *FleetTestSuite) processStateChangedOnTheHost(process string, state string) error { diff --git a/e2e/_suites/fleet/ingest-manager_test.go b/e2e/_suites/fleet/ingest-manager_test.go index 6c82f704dc..97c61404a6 100644 --- a/e2e/_suites/fleet/ingest-manager_test.go +++ b/e2e/_suites/fleet/ingest-manager_test.go @@ -91,10 +91,10 @@ func setUpSuite() { imts = IngestManagerTestSuite{ Fleet: &FleetTestSuite{ Installers: map[string]ElasticAgentInstaller{ - "centos-systemd": GetElasticAgentInstaller("centos", "systemd"), - "centos-tar": GetElasticAgentInstaller("centos", "tar"), - "debian-systemd": GetElasticAgentInstaller("debian", "systemd"), - "debian-tar": GetElasticAgentInstaller("debian", "tar"), + "centos-systemd-" + agentVersion: GetElasticAgentInstaller("centos", "systemd", agentVersion, false), + "centos-tar-" + agentVersion: GetElasticAgentInstaller("centos", "tar", agentVersion, false), + "debian-systemd-" + agentVersion: GetElasticAgentInstaller("debian", "systemd", agentVersion, false), + "debian-tar-" + agentVersion: GetElasticAgentInstaller("debian", "tar", agentVersion, false), }, }, StandAlone: &StandAloneTestSuite{}, diff --git a/e2e/_suites/fleet/installers.go b/e2e/_suites/fleet/installers.go index c992e0f7dd..55fe949bf2 100644 --- a/e2e/_suites/fleet/installers.go +++ b/e2e/_suites/fleet/installers.go @@ -157,6 +157,7 @@ type TARPackage struct { arch string artifact string OS string + stale bool version string } @@ -233,6 +234,12 @@ func (i *TARPackage) Preinstall() error { return nil } +// Stale sets the stale state +func (i *TARPackage) Stale(stale bool) *TARPackage { + i.stale = stale + return i +} + // Uninstall uninstalls a TAR package func (i *TARPackage) Uninstall() error { args := []string{"-f"} diff --git a/e2e/_suites/fleet/services.go b/e2e/_suites/fleet/services.go index cb18ce1fbc..0eb3e932b1 100644 --- a/e2e/_suites/fleet/services.go +++ b/e2e/_suites/fleet/services.go @@ -163,7 +163,7 @@ func runElasticAgentCommand(profile string, image string, service string, proces // be defined by that value // Else, if the environment variable BEATS_USE_CI_SNAPSHOTS is set, then the artifact // to be downloaded will be defined by the latest snapshot produced by the Beats CI. -func downloadAgentBinary(artifact string, version string, OS string, arch string, extension string) (string, string, error) { +func downloadAgentBinary(artifact string, version string, OS string, arch string, extension string, stale bool) (string, string, error) { fileName := fmt.Sprintf("%s-%s-%s.%s", artifact, version, arch, extension) handleDownload := func(URL string, fileName string) (string, string, error) { @@ -196,7 +196,7 @@ func downloadAgentBinary(artifact string, version string, OS string, arch string if useCISnapshots { log.Debug("Using CI snapshots for the Elastic Agent") - bucketFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + bucketFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, stale) maxTimeout := time.Duration(timeoutFactor) * time.Minute @@ -217,7 +217,7 @@ func downloadAgentBinary(artifact string, version string, OS string, arch string } // GetElasticAgentInstaller returns an installer from a docker image -func GetElasticAgentInstaller(image string, installerType string) ElasticAgentInstaller { +func GetElasticAgentInstaller(image string, installerType string, version string, stale bool) ElasticAgentInstaller { log.WithFields(log.Fields{ "image": image, "installer": installerType, @@ -226,13 +226,13 @@ func GetElasticAgentInstaller(image string, installerType string) ElasticAgentIn var installer ElasticAgentInstaller var err error if "centos" == image && "tar" == installerType { - installer, err = newTarInstaller("centos", "latest") + installer, err = newTarInstaller("centos", "latest", version, stale) } else if "centos" == image && "systemd" == installerType { - installer, err = newCentosInstaller("centos", "latest") + installer, err = newCentosInstaller("centos", "latest", version, stale) } else if "debian" == image && "tar" == installerType { - installer, err = newTarInstaller("debian", "stretch") + installer, err = newTarInstaller("debian", "stretch", version, stale) } else if "debian" == image && "systemd" == installerType { - installer, err = newDebianInstaller("debian", "stretch") + installer, err = newDebianInstaller("debian", "stretch", version, stale) } else { log.WithFields(log.Fields{ "image": image, @@ -252,7 +252,7 @@ func GetElasticAgentInstaller(image string, installerType string) ElasticAgentIn } // getGCPBucketCoordinates it calculates the bucket path in GCP -func getGCPBucketCoordinates(fileName string, artifact string, version string, OS string, arch string, extension string) (string, string, string, string) { +func getGCPBucketCoordinates(fileName string, artifact string, version string, OS string, arch string, extension string, stale bool) (string, string, string, string) { if extension == "tar.gz" { fileName = fmt.Sprintf("%s-%s-%s-%s.%s", artifact, version, OS, arch, extension) } @@ -286,6 +286,11 @@ func getGCPBucketCoordinates(fileName string, artifact string, version string, O object = fmt.Sprintf("%s/%s", artifact, newFileName) } + if stale { + prefix = fmt.Sprintf("snapshots/%s", artifact) + object = newFileName + } + return newFileName, bucket, prefix, object } @@ -293,20 +298,19 @@ func isSystemdBased(image string) bool { return strings.HasSuffix(image, "-systemd") } -// newCentosInstaller returns an instance of the Centos installer -func newCentosInstaller(image string, tag string) (ElasticAgentInstaller, error) { +// newCentosInstaller returns an instance of the Centos installer for a specific version +func newCentosInstaller(image string, tag string, version string, stale bool) (ElasticAgentInstaller, error) { image = image + "-systemd" // we want to consume systemd boxes service := image profile := FleetProfileName // extract the agent in the box, as it's mounted as a volume artifact := "elastic-agent" - version := agentVersion os := "linux" arch := "x86_64" extension := "rpm" - binaryName, binaryPath, err := downloadAgentBinary(artifact, version, os, arch, extension) + binaryName, binaryPath, err := downloadAgentBinary(artifact, version, os, arch, extension, stale) if err != nil { log.WithFields(log.Fields{ "artifact": artifact, @@ -358,20 +362,19 @@ func newCentosInstaller(image string, tag string) (ElasticAgentInstaller, error) }, nil } -// newDebianInstaller returns an instance of the Debian installer -func newDebianInstaller(image string, tag string) (ElasticAgentInstaller, error) { +// newDebianInstaller returns an instance of the Debian installer for a specific version +func newDebianInstaller(image string, tag string, version string, stale bool) (ElasticAgentInstaller, error) { image = image + "-systemd" // we want to consume systemd boxes service := image profile := FleetProfileName // extract the agent in the box, as it's mounted as a volume artifact := "elastic-agent" - version := agentVersion os := "linux" arch := "amd64" extension := "deb" - binaryName, binaryPath, err := downloadAgentBinary(artifact, version, os, arch, extension) + binaryName, binaryPath, err := downloadAgentBinary(artifact, version, os, arch, extension, stale) if err != nil { log.WithFields(log.Fields{ "artifact": artifact, @@ -423,20 +426,19 @@ func newDebianInstaller(image string, tag string) (ElasticAgentInstaller, error) }, nil } -// newTarInstaller returns an instance of the Debian installer -func newTarInstaller(image string, tag string) (ElasticAgentInstaller, error) { +// newTarInstaller returns an instance of the Debian installer for a specific version +func newTarInstaller(image string, tag string, version string, stale bool) (ElasticAgentInstaller, error) { image = image + "-systemd" // we want to consume systemd boxes service := image profile := FleetProfileName // extract the agent in the box, as it's mounted as a volume artifact := "elastic-agent" - version := agentVersion os := "linux" arch := "x86_64" extension := "tar.gz" - tarFile, binaryPath, err := downloadAgentBinary(artifact, version, os, arch, extension) + tarFile, binaryPath, err := downloadAgentBinary(artifact, version, os, arch, extension, stale) if err != nil { log.WithFields(log.Fields{ "artifact": artifact, @@ -461,6 +463,7 @@ func newTarInstaller(image string, tag string) (ElasticAgentInstaller, error) { // installerPackage := NewTARPackage(tarFile, profile, image, service). + Stale(stale). WithArch(arch). WithArtifact(artifact). WithOS(os). diff --git a/e2e/_suites/fleet/services_test.go b/e2e/_suites/fleet/services_test.go index 615e6f23c9..bdce15b625 100644 --- a/e2e/_suites/fleet/services_test.go +++ b/e2e/_suites/fleet/services_test.go @@ -22,12 +22,26 @@ func TestGetGCPBucketCoordinates_Commits(t *testing.T) { extension := "rpm" fileName := "elastic-agent-" + testVersion + "-x86_64.rpm" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "commits/0123456789") assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-x86_64.rpm") assert.Equal(t, object, "elastic-agent/elastic-agent-"+testVersion+"-x86_64.rpm") }) + t.Run("Fetching commits bucket for stale RPM package in the snapshots folder", func(t *testing.T) { + defer os.Unsetenv("GITHUB_CHECK_SHA1") + os.Setenv("GITHUB_CHECK_SHA1", "0123456789") + + arch := "x86_64" + extension := "rpm" + fileName := "elastic-agent-" + testVersion + "-x86_64.rpm" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-x86_64.rpm") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-x86_64.rpm") + }) t.Run("Fetching commits bucket for DEB package", func(t *testing.T) { defer os.Unsetenv("GITHUB_CHECK_SHA1") @@ -37,12 +51,26 @@ func TestGetGCPBucketCoordinates_Commits(t *testing.T) { extension := "deb" fileName := "elastic-agent-" + testVersion + "-amd64.deb" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "commits/0123456789") assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-amd64.deb") assert.Equal(t, object, "elastic-agent/elastic-agent-"+testVersion+"-amd64.deb") }) + t.Run("Fetching commits bucket for stale DEB package in the snapshots folder", func(t *testing.T) { + defer os.Unsetenv("GITHUB_CHECK_SHA1") + os.Setenv("GITHUB_CHECK_SHA1", "0123456789") + + arch := "amd64" + extension := "deb" + fileName := "elastic-agent-" + testVersion + "-amd64.deb" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-amd64.deb") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-amd64.deb") + }) t.Run("Fetching commits bucket for TAR package adds OS to fileName and object", func(t *testing.T) { defer os.Unsetenv("GITHUB_CHECK_SHA1") @@ -52,12 +80,26 @@ func TestGetGCPBucketCoordinates_Commits(t *testing.T) { extension := "tar.gz" fileName := "elastic-agent-" + testVersion + "-linux-x86_64.tar.gz" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "commits/0123456789") assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") assert.Equal(t, object, "elastic-agent/elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") }) + t.Run("Fetching commits bucket for stale TAR package adds OS to fileName and object in the snapshots folder", func(t *testing.T) { + defer os.Unsetenv("GITHUB_CHECK_SHA1") + os.Setenv("GITHUB_CHECK_SHA1", "0123456789") + + arch := "x86_64" + extension := "tar.gz" + fileName := "elastic-agent-" + testVersion + "-linux-x86_64.tar.gz" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") + }) } func TestGetGCPBucketCoordinates_CommitsForAPullRequest(t *testing.T) { @@ -73,12 +115,26 @@ func TestGetGCPBucketCoordinates_CommitsForAPullRequest(t *testing.T) { extension := "rpm" fileName := "elastic-agent-" + testVersion + "-x86_64.rpm" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "pull-requests/pr-23456") assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-x86_64.rpm") assert.Equal(t, object, "elastic-agent/elastic-agent-"+testVersion+"-x86_64.rpm") }) + t.Run("Fetching commits bucket for stale RPM package in the snapshots folder", func(t *testing.T) { + defer os.Unsetenv("GITHUB_CHECK_SHA1") + os.Setenv("GITHUB_CHECK_SHA1", "0123456789") + + arch := "x86_64" + extension := "rpm" + fileName := "elastic-agent-" + testVersion + "-x86_64.rpm" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-x86_64.rpm") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-x86_64.rpm") + }) t.Run("Fetching commits bucket for DEB package", func(t *testing.T) { defer os.Unsetenv("GITHUB_CHECK_SHA1") @@ -88,12 +144,26 @@ func TestGetGCPBucketCoordinates_CommitsForAPullRequest(t *testing.T) { extension := "deb" fileName := "elastic-agent-" + testVersion + "-amd64.deb" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "pull-requests/pr-23456") assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-amd64.deb") assert.Equal(t, object, "elastic-agent/elastic-agent-"+testVersion+"-amd64.deb") }) + t.Run("Fetching commits bucket for stale DEB package in the snapshots folder", func(t *testing.T) { + defer os.Unsetenv("GITHUB_CHECK_SHA1") + os.Setenv("GITHUB_CHECK_SHA1", "0123456789") + + arch := "amd64" + extension := "deb" + fileName := "elastic-agent-" + testVersion + "-amd64.deb" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-amd64.deb") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-amd64.deb") + }) t.Run("Fetching commits bucket for TAR package adds OS to fileName and object", func(t *testing.T) { defer os.Unsetenv("GITHUB_CHECK_SHA1") @@ -103,12 +173,26 @@ func TestGetGCPBucketCoordinates_CommitsForAPullRequest(t *testing.T) { extension := "tar.gz" fileName := "elastic-agent-" + testVersion + "-linux-x86_64.tar.gz" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "pull-requests/pr-23456") assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") assert.Equal(t, object, "elastic-agent/elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") }) + t.Run("Fetching commits bucket for stale TAR package adds OS to fileName and object in the snapshots folder", func(t *testing.T) { + defer os.Unsetenv("GITHUB_CHECK_SHA1") + os.Setenv("GITHUB_CHECK_SHA1", "0123456789") + + arch := "x86_64" + extension := "tar.gz" + fileName := "elastic-agent-" + testVersion + "-linux-x86_64.tar.gz" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") + }) } func TestGetGCPBucketCoordinates_PullRequests(t *testing.T) { @@ -121,36 +205,69 @@ func TestGetGCPBucketCoordinates_PullRequests(t *testing.T) { extension := "rpm" fileName := "elastic-agent-" + testVersion + "-x86_64.rpm" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-x86_64.rpm") assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "pull-requests/pr-23456") assert.Equal(t, object, "elastic-agent/elastic-agent-"+testVersion+"-x86_64.rpm") }) + t.Run("Fetching commits bucket for stale RPM package in the snapshots folder", func(t *testing.T) { + arch := "x86_64" + extension := "rpm" + fileName := "elastic-agent-" + testVersion + "-x86_64.rpm" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-x86_64.rpm") + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-x86_64.rpm") + }) t.Run("Fetching commits bucket for DEB package", func(t *testing.T) { arch := "amd64" extension := "deb" fileName := "elastic-agent-" + testVersion + "-amd64.deb" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-amd64.deb") assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "pull-requests/pr-23456") assert.Equal(t, object, "elastic-agent/elastic-agent-"+testVersion+"-amd64.deb") }) + t.Run("Fetching commits bucket for stale DEB package in the snapshots folder", func(t *testing.T) { + arch := "amd64" + extension := "deb" + fileName := "elastic-agent-" + testVersion + "-amd64.deb" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-amd64.deb") + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-amd64.deb") + }) t.Run("Fetching commits bucket for TAR package adds OS to fileName and object", func(t *testing.T) { arch := "x86_64" extension := "tar.gz" fileName := "elastic-agent-" + testVersion + "-linux-x86_64.tar.gz" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "pull-requests/pr-23456") assert.Equal(t, object, "elastic-agent/elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") }) + t.Run("Fetching commits bucket for stale TAR package adds OS to fileName and object in the snapshots folder", func(t *testing.T) { + arch := "x86_64" + extension := "tar.gz" + fileName := "elastic-agent-" + testVersion + "-linux-x86_64.tar.gz" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") + }) } func TestGetGCPBucketCoordinates_Snapshots(t *testing.T) { @@ -163,7 +280,18 @@ func TestGetGCPBucketCoordinates_Snapshots(t *testing.T) { extension := "rpm" fileName := "elastic-agent-" + testVersion + "-x86_64.rpm" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-x86_64.rpm") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-x86_64.rpm") + }) + t.Run("Fetching commits bucket for stale RPM package", func(t *testing.T) { + arch := "x86_64" + extension := "rpm" + fileName := "elastic-agent-" + testVersion + "-x86_64.rpm" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "snapshots/elastic-agent") assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-x86_64.rpm") @@ -175,7 +303,18 @@ func TestGetGCPBucketCoordinates_Snapshots(t *testing.T) { extension := "deb" fileName := "elastic-agent-" + testVersion + "-amd64.deb" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-amd64.deb") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-amd64.deb") + }) + t.Run("Fetching commits bucket for stale DEB package", func(t *testing.T) { + arch := "amd64" + extension := "deb" + fileName := "elastic-agent-" + testVersion + "-amd64.deb" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "snapshots/elastic-agent") assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-amd64.deb") @@ -187,7 +326,18 @@ func TestGetGCPBucketCoordinates_Snapshots(t *testing.T) { extension := "tar.gz" fileName := "elastic-agent-" + testVersion + "-linux-x86_64.tar.gz" - newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension) + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, false) + assert.Equal(t, bucket, "beats-ci-artifacts") + assert.Equal(t, prefix, "snapshots/elastic-agent") + assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") + assert.Equal(t, object, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") + }) + t.Run("Fetching commits bucket for stale TAR package adds OS to fileName and object", func(t *testing.T) { + arch := "x86_64" + extension := "tar.gz" + fileName := "elastic-agent-" + testVersion + "-linux-x86_64.tar.gz" + + newFileName, bucket, prefix, object := getGCPBucketCoordinates(fileName, artifact, version, OS, arch, extension, true) assert.Equal(t, bucket, "beats-ci-artifacts") assert.Equal(t, prefix, "snapshots/elastic-agent") assert.Equal(t, newFileName, "elastic-agent-"+testVersion+"-linux-x86_64.tar.gz") From b7cdb506bbeb31da6cb87c8b8d19c7968f383a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 18:12:37 +0100 Subject: [PATCH 05/10] fix: append snapshot to the stale version when using CI snapshots --- e2e/_suites/fleet/ingest-manager_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/e2e/_suites/fleet/ingest-manager_test.go b/e2e/_suites/fleet/ingest-manager_test.go index 97c61404a6..fe61fa2341 100644 --- a/e2e/_suites/fleet/ingest-manager_test.go +++ b/e2e/_suites/fleet/ingest-manager_test.go @@ -83,6 +83,11 @@ func setUpSuite() { agentVersion = shell.GetEnv("ELASTIC_AGENT_VERSION", agentVersionBase) agentStaleVersion = shell.GetEnv("ELASTIC_AGENT_STALE_VERSION", agentStaleVersion) + useCISnapshots := shell.GetEnvBool("BEATS_USE_CI_SNAPSHOTS") + if useCISnapshots && !strings.HasSuffix(agentStaleVersion, "-SNAPSHOT") { + agentStaleVersion += "-SNAPSHOT" + } + // check if version is an alias agentVersion = e2e.GetElasticArtifactVersion(agentVersion) From ceb1325f39a209a4c0f2890e3dee404fcbff80d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 18:13:33 +0100 Subject: [PATCH 06/10] fix: check for version aliases with non-stale versions --- e2e/_suites/fleet/installers.go | 6 +++++- e2e/_suites/fleet/services.go | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/e2e/_suites/fleet/installers.go b/e2e/_suites/fleet/installers.go index 55fe949bf2..24d4a6670f 100644 --- a/e2e/_suites/fleet/installers.go +++ b/e2e/_suites/fleet/installers.go @@ -215,7 +215,10 @@ func (i *TARPackage) Preinstall() error { return err } - version := checkElasticAgentVersion(i.version) + version := i.version + if !i.stale { + version = checkElasticAgentVersion(i.version) + } // simplify layout cmds := []string{"mv", fmt.Sprintf("/%s-%s-%s-%s", i.artifact, version, i.OS, i.arch), "/elastic-agent"} @@ -226,6 +229,7 @@ func (i *TARPackage) Preinstall() error { "error": err, "image": i.image, "service": i.service, + "version": version, }).Error("Could not extract agent package in the box") return err diff --git a/e2e/_suites/fleet/services.go b/e2e/_suites/fleet/services.go index 0eb3e932b1..8f4f0305d9 100644 --- a/e2e/_suites/fleet/services.go +++ b/e2e/_suites/fleet/services.go @@ -208,7 +208,12 @@ func downloadAgentBinary(artifact string, version string, OS string, arch string return handleDownload(downloadURL, bucketFileName) } - downloadURL, err = e2e.GetElasticArtifactURL(artifact, checkElasticAgentVersion(version), OS, arch, extension) + downloadVersion := version + if !stale { + downloadVersion = checkElasticAgentVersion(version) + } + + downloadURL, err = e2e.GetElasticArtifactURL(artifact, downloadVersion, OS, arch, extension) if err != nil { return "", "", err } From d408bf6a07e938f966ee66a129143c3f03dc6fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 18:14:51 +0100 Subject: [PATCH 07/10] chore: store current agent version in the test suite struct --- e2e/_suites/fleet/fleet.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/e2e/_suites/fleet/fleet.go b/e2e/_suites/fleet/fleet.go index e6b412fa2a..a92c8e2518 100644 --- a/e2e/_suites/fleet/fleet.go +++ b/e2e/_suites/fleet/fleet.go @@ -42,6 +42,7 @@ type FleetTestSuite struct { CurrentToken string // current enrollment token CurrentTokenID string // current enrollment tokenID Hostname string // the hostname of the container + Version string // current elastic-agent version // integrations Integration IntegrationPackage // the installed integration PolicyUpdatedAt string // the moment the policy was updated @@ -107,6 +108,8 @@ func (fts *FleetTestSuite) afterScenario() { func (fts *FleetTestSuite) beforeScenario() { fts.Cleanup = false + fts.Version = agentVersion + // create policy with system monitoring enabled defaultPolicy, err := getAgentDefaultPolicy() if err != nil { @@ -148,8 +151,8 @@ func (fts *FleetTestSuite) contributeSteps(s *godog.ScenarioContext) { } func (fts *FleetTestSuite) anStaleAgentIsDeployedToFleetWithInstaller(image, version, installerType string) error { - agentVersionBackup := agentVersion - defer func() { agentVersion = agentVersionBackup }() + agentVersionBackup := fts.Version + defer func() { fts.Version = agentVersionBackup }() switch version { case "stale": @@ -160,7 +163,7 @@ func (fts *FleetTestSuite) anStaleAgentIsDeployedToFleetWithInstaller(image, ver version = agentStaleVersion } - agentVersion = version + fts.Version = version // prepare installer for stale version if fts.Version != agentVersionBackup { @@ -174,6 +177,12 @@ func (fts *FleetTestSuite) anStaleAgentIsDeployedToFleetWithInstaller(image, ver func (fts *FleetTestSuite) installCerts(targetOS string) error { installer := fts.getInstaller() if installer.InstallCertsFn == nil { + log.WithFields(log.Fields{ + "installer": installer, + "version": fts.Version, + "agentVersion": agentVersion, + "agentStaleVersion": agentStaleVersion, + }).Error("No installer found") return errors.New("no installer found") } From 5ee04e528594da42d24b30b449be58dc0ebc0998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 19:26:55 +0100 Subject: [PATCH 08/10] chore: make sure the layout is properly created for TAR installer --- e2e/_suites/fleet/installers.go | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/e2e/_suites/fleet/installers.go b/e2e/_suites/fleet/installers.go index 24d4a6670f..75589ea2e5 100644 --- a/e2e/_suites/fleet/installers.go +++ b/e2e/_suites/fleet/installers.go @@ -221,18 +221,23 @@ func (i *TARPackage) Preinstall() error { } // simplify layout - cmds := []string{"mv", fmt.Sprintf("/%s-%s-%s-%s", i.artifact, version, i.OS, i.arch), "/elastic-agent"} - err = execCommandInService(i.profile, i.image, i.service, cmds, false) - if err != nil { - log.WithFields(log.Fields{ - "command": cmds, - "error": err, - "image": i.image, - "service": i.service, - "version": version, - }).Error("Could not extract agent package in the box") - - return err + cmds := [][]string{ + []string{"rm", "-fr", "/elastic-agent"}, + []string{"mv", fmt.Sprintf("/%s-%s-%s-%s", i.artifact, version, i.OS, i.arch), "/elastic-agent"}, + } + for _, cmd := range cmds { + err = execCommandInService(i.profile, i.image, i.service, cmd, false) + if err != nil { + log.WithFields(log.Fields{ + "command": cmd, + "error": err, + "image": i.image, + "service": i.service, + "version": version, + }).Error("Could not extract agent package in the box") + + return err + } } return nil From 1827ee2c02ea23713109f44103966517af0ea076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 19:51:06 +0100 Subject: [PATCH 09/10] chore: add make goals for testing fleet use cases --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index c848c15b56..875dac0ac9 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,18 @@ clean-docker: clean-workspace: rm -fr ~/.op/compose +.PHONY: e2e-fleet-fleet +e2e-fleet-fleet: + SUITE="fleet" TAGS="fleet_mode_agent" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE DEVELOPER_MODE=true $(MAKE) -C e2e functional-test + +.PHONY: e2e-fleet-fleet-ci-snapshots +e2e-fleet-fleet-ci-snapshots: + SUITE="fleet" TAGS="fleet_mode_agent" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true GITHUB_CHECK_SHA1=a1962c8864016010adcde9f35bd8378debb4fbf7 $(MAKE) -C e2e functional-test + +.PHONY: e2e-fleet-fleet-pr-ci-snapshots +e2e-fleet-fleet-pr-ci-snapshots: + SUITE="fleet" TAGS="fleet_mode_agent" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true ELASTIC_AGENT_VERSION=pr-14954 $(MAKE) -C e2e functional-test + .PHONY: e2e-fleet-nightly e2e-fleet-nightly: SUITE="fleet" TAGS="fleet_mode_agent && nightly" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE DEVELOPER_MODE=true $(MAKE) -C e2e functional-test From 25661262d39ecd750d866e53e51f616094c9bd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Wed, 27 Jan 2021 19:51:53 +0100 Subject: [PATCH 10/10] chore: move Make goals to the e2e Makefile --- Makefile | 20 -------------------- e2e/Makefile | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 875dac0ac9..d761f57f4c 100644 --- a/Makefile +++ b/Makefile @@ -9,26 +9,6 @@ clean-docker: clean-workspace: rm -fr ~/.op/compose -.PHONY: e2e-fleet-fleet -e2e-fleet-fleet: - SUITE="fleet" TAGS="fleet_mode_agent" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE DEVELOPER_MODE=true $(MAKE) -C e2e functional-test - -.PHONY: e2e-fleet-fleet-ci-snapshots -e2e-fleet-fleet-ci-snapshots: - SUITE="fleet" TAGS="fleet_mode_agent" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true GITHUB_CHECK_SHA1=a1962c8864016010adcde9f35bd8378debb4fbf7 $(MAKE) -C e2e functional-test - -.PHONY: e2e-fleet-fleet-pr-ci-snapshots -e2e-fleet-fleet-pr-ci-snapshots: - SUITE="fleet" TAGS="fleet_mode_agent" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true ELASTIC_AGENT_VERSION=pr-14954 $(MAKE) -C e2e functional-test - -.PHONY: e2e-fleet-nightly -e2e-fleet-nightly: - SUITE="fleet" TAGS="fleet_mode_agent && nightly" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE DEVELOPER_MODE=true $(MAKE) -C e2e functional-test - -.PHONY: e2e-fleet-nightly-ci-snapshots -e2e-fleet-nightly-ci-snapshots: - SUITE="fleet" TAGS="fleet_mode_agent && nightly" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true GITHUB_CHECK_SHA1=a1962c8864016010adcde9f35bd8378debb4fbf7 $(MAKE) -C e2e functional-test - .PHONY: install install: go get -v -t ./... diff --git a/e2e/Makefile b/e2e/Makefile index 8223e897ef..3fd8b194ff 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -91,3 +91,25 @@ sync-integrations: unit-test: gotestsum --format testname -- -count=1 -timeout=$(TEST_TIMEOUT) ./... cd _suites && gotestsum --format testname -- -count=1 -timeout=$(TEST_TIMEOUT) ./... + +## Test examples + +.PHONY: fleet-fleet +fleet-fleet: + SUITE="fleet" TAGS="fleet_mode_agent" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE DEVELOPER_MODE=true $(MAKE) functional-test + +.PHONY: fleet-fleet-ci-snapshots +fleet-fleet-ci-snapshots: + SUITE="fleet" TAGS="fleet_mode_agent" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true GITHUB_CHECK_SHA1=a1962c8864016010adcde9f35bd8378debb4fbf7 $(MAKE) functional-test + +.PHONY: fleet-fleet-pr-ci-snapshots +fleet-fleet-pr-ci-snapshots: + SUITE="fleet" TAGS="fleet_mode_agent" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true ELASTIC_AGENT_VERSION=pr-14954 $(MAKE) functional-test + +.PHONY: fleet-nightly +fleet-nightly: + SUITE="fleet" TAGS="fleet_mode_agent && nightly" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE DEVELOPER_MODE=true $(MAKE) functional-test + +.PHONY: fleet-nightly-ci-snapshots +fleet-nightly-ci-snapshots: + SUITE="fleet" TAGS="fleet_mode_agent && nightly" TIMEOUT_FACTOR=3 LOG_LEVEL=TRACE BEATS_USE_CI_SNAPSHOTS=true DEVELOPER_MODE=true GITHUB_CHECK_SHA1=a1962c8864016010adcde9f35bd8378debb4fbf7 $(MAKE) functional-test