Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce upgrade tests from released versions (#2955)
## What does this PR do? This PR adds upgrade tests for both standalone and managed agent from some versions of the current and previous major release to the latest snapshot. The tests will select: - up to 2 versions with the same major version as the current agent - up to 1 version from a previous major version These versions are retrieved using the Artifact API and working backwards through the versions, excluding snapshots. The _up to_ part is because under certain circumstances (new major release, for example) we may not find enough versions fitting the criteria. The tests `TestStandaloneUpgrade` and `TestFleetManagedUpgrade` will start a subtest (using `t.Run()`) for each version to be used as a starting point for the upgrade and then upgrade it to the latest version of agent. Current limitations: - We are currently using the ArtifactFetcher so the starting elastic agent version all come from the artifact API. For all agent versions that allow the `--skip-verify` we use the packaged elastic agent as artifact for the upgrade via `--sourceURI` parameter ## Why is it important? We need to have automated tests for the common upgrade scenarios to detect upgrade issues as soon as possible in the development cycle. ## How to test this PR locally We can run the integration tests using `AGENT_VERSION="8.10.0-SNAPSHOT" GOTEST_FLAGS="-test.run ^(TestFleetManagedUpgrade|TestStandaloneUpgrade)$" mage integration:test` or if you want to run just a specific version upgrade scenario we can use (for example only standalone upgrade from 8.9.0 to 8.10.0-SNAPSHOT): `AGENT_VERSION="8.10.0-SNAPSHOT" GOTEST_FLAGS="-test.run ^TestStandaloneUpgrade/Upgrade_8.9.0_to_8.10.0-SNAPSHOT$"` --------- Co-authored-by: Blake Rouse <[email protected]> (cherry picked from commit cfd059d) # Conflicts: # testing/integration/upgrade_test.go
- Loading branch information