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 #2834 and #3164) Enhance mock fleet-server and add --proxy-url integration test and disable tests #3147

Merged
merged 4 commits into from
Aug 16, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 28, 2023

Manual EDIT:
This backport backports 2 PRs:

The latter skips the tests added by the former while #3154 is addressed.

Therefore #3209 was closed in favour of this PR.

This is an automatic backport of pull request #2834 done by Mergify.
Cherry-pick of 732d7c0 has failed:

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

You are currently cherry-picking commit 732d7c0e59.
  (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:   .github/workflows/build.yml
	modified:   Vagrantfile
	modified:   docs/test-framework-dev-guide.md
	modified:   magefile.go
	modified:   pkg/testing/define/define.go
	modified:   pkg/testing/fixture.go
	modified:   pkg/testing/fixture_install.go
	modified:   testing/fleetservertest/README.md
	new file:   testing/fleetservertest/ackableactions.go
	new file:   testing/fleetservertest/auth.go
	modified:   testing/fleetservertest/checkin.go
	modified:   testing/fleetservertest/fleetserver.go
	modified:   testing/fleetservertest/fleetserver_test.go
	modified:   testing/fleetservertest/handlers.go
	modified:   testing/fleetservertest/models.go
	modified:   testing/fleetservertest/server.go
	new file:   testing/integration/README.md
	modified:   testing/integration/fqdn_test.go
	new file:   testing/integration/proxy_url_test.go
	new file:   testing/proxytest/proxytest.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   version/version.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 added backport conflicts There is a conflict in the backported pull request labels Jul 28, 2023
@mergify mergify bot requested a review from a team as a code owner July 28, 2023 16:45
@mergify mergify bot requested review from blakerouse and faec and removed request for a team July 28, 2023 16:45
@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 28, 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-16T09:44:31.609+0000

  • Duration: 26 min 14 sec

Test stats 🧪

Test Results
Failed 0
Passed 6095
Skipped 27
Total 6122

💚 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!)

@mergify
Copy link
Contributor Author

mergify bot commented Jul 31, 2023

This pull request has not been merged yet. Could you please review and merge it @AndersonQ? 🙏

@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 31, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.701% (76/77) 👍
Files 65.827% (183/278) 👍 0.134
Classes 64.865% (336/518) 👎 -0.301
Methods 52.17% (1046/2005) 👎 -0.064
Lines 38.085% (11993/31490) 👍 0.204
Conditionals 100.0% (0/0) 💚

@mergify
Copy link
Contributor Author

mergify bot commented Aug 2, 2023

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mergify/bp/8.9/pr-2834 upstream/mergify/bp/8.9/pr-2834
git merge upstream/8.9
git push upstream mergify/bp/8.9/pr-2834

@pierrehilbert pierrehilbert added the Team:Elastic-Agent Label for the Agent team label Aug 3, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@mergify
Copy link
Contributor Author

mergify bot commented Aug 7, 2023

This pull request has not been merged yet. Could you please review and merge it @AndersonQ? 🙏

* enhance test fleet-server
Now a almost fully functional mock fleet-server can be instantiated with a single call to fleetservertest.NewServerWithHandlers. The only missing handlers are the upload handlers.
testing/integration/proxy_url_test.go works as example on how to use the new features of  the test fleet-server

* add proxytest.Proxy:
A naive proxy to be used on tests which allows to configure URL rewrites and check all the calls made to it.
check the tests on testing/integration/proxy_url_test.go to see how to use proxytest.Proxy.

* add integration tests for the fleet-server proxy
The tests cover defining a proxy through --proxy-url and in the policy and the correct priority is respected

* fix the Go version used on the Github workflows
now it reads the version from the .go-version and not from the go.mod anymore.

* increase the memory allocated to the elastic-agent vagrant box

* allow -SNAPHOT versions to be passed to define.NewFixture

* add more helper methods to testing.Fixture and Install accepts more flags

* add version.Agent, a exported constant with the agent version

(cherry picked from commit 732d7c0)

# Conflicts:
#	version/version.go
@mergify
Copy link
Contributor Author

mergify bot commented Aug 14, 2023

This pull request has not been merged yet. Could you please review and merge it @AndersonQ? 🙏

All of the proxy tests are currently flaky and fail regularly, see
#3154

Disabling them while we investigate a fix to unblock CI.
@AndersonQ AndersonQ changed the title [8.9](backport #2834) Enhance mock fleet-server and add --proxy-url integration test [8.9](backport #2834 and #3164) Enhance mock fleet-server and add --proxy-url integration test and disable tests Aug 16, 2023
@AndersonQ AndersonQ merged commit 05c5479 into 8.9 Aug 16, 2023
9 checks passed
@AndersonQ AndersonQ deleted the mergify/bp/8.9/pr-2834 branch August 16, 2023 12:20
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 Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants