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

[8.9](backport #2955) Introduce upgrade tests from released versions #3173

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Aug 3, 2023

This is an automatic backport of pull request #2955 done by Mergify.
Cherry-pick of cfd059d has failed:

On branch mergify/bp/8.9/pr-2955
Your branch is up to date with 'origin/8.9'.

You are currently cherry-picking commit cfd059dab9.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   pkg/testing/fixture.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   testing/integration/upgrade_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

@mergify mergify bot requested a review from a team as a code owner August 3, 2023 06:25
@mergify mergify bot requested review from michalpristas and blakerouse and removed request for a team August 3, 2023 06:25
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Aug 3, 2023
@mergify mergify bot assigned pchila Aug 3, 2023
@elasticmachine
Copy link
Contributor

elasticmachine commented Aug 3, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-08-03T16:59:08.511+0000

  • Duration: 23 min 42 sec

Test stats 🧪

Test Results
Failed 0
Passed 6007
Skipped 23
Total 6030

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Aug 3, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.684% (75/76) 👍
Files 67.045% (177/264) 👍
Classes 66.263% (328/495) 👍
Methods 53.173% (1014/1907) 👎 -0.028
Lines 39.128% (11578/29590) 👎 -0.029
Conditionals 100.0% (0/0) 💚

@pchila
Copy link
Member

pchila commented Aug 3, 2023

@Mergifyio rebase

pchila added 2 commits August 3, 2023 12:20
## 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 <blake.rouse@elastic.co>
(cherry picked from commit cfd059d)

# Conflicts:
#	testing/integration/upgrade_test.go
@mergify
Copy link
Contributor Author

mergify bot commented Aug 3, 2023

rebase

✅ Branch has been successfully rebased

@pchila pchila force-pushed the mergify/bp/8.9/pr-2955 branch from ea33ac2 to 386784a Compare August 3, 2023 12:20
@pchila
Copy link
Member

pchila commented Aug 3, 2023

buildkite test this

1 similar comment
@pchila
Copy link
Member

pchila commented Aug 3, 2023

buildkite test this

@pchila
Copy link
Member

pchila commented Aug 3, 2023

buildkite test this

@pchila pchila merged commit 2cc98b8 into 8.9 Aug 4, 2023
@pchila pchila deleted the mergify/bp/8.9/pr-2955 branch August 4, 2023 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants