Move mock proxy test server from elastic-agent to elastic-agent-libs for common use#358
Merged
khushijain21 merged 4 commits intoelastic:mainfrom Sep 29, 2025
Merged
Conversation
elastic-agent to elastic-agent-libs for common use
AndersonQ
requested changes
Sep 26, 2025
Member
AndersonQ
left a comment
There was a problem hiding this comment.
@khushijain21, could you bring the whole proxytest package from the agent repo? On elastic-agent/testing/proxytest there are 2 important files which are not there, the tests for the proxy and an example of how to use it as a "cli" application.
belimawr
reviewed
Sep 26, 2025
Contributor
belimawr
left a comment
There was a problem hiding this comment.
I agree with @AndersonQ, it's better to bring the whole package, which includes the tests.
It also makes a small change to the original code. proxy-server now writes the incoming headers first and then the status code.
This is actually a bugfix. The headers should be fully set before calling WriteHeader. Thanks for fixing that!
Contributor
Author
done |
Collaborator
💚 Build Succeeded
History
|
6 tasks
AndersonQ
approved these changes
Sep 29, 2025
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR moves mock proxy server files from https://github.com/elastic/elastic-agent/blob/615190be3f6a28403883f6b4983764558173e0e7/testing/proxytest/proxytest.go
and https://github.com/elastic/elastic-agent/blob/615190be3f6a28403883f6b4983764558173e0e7/testing/proxytest/https.go
to elastic-agent-libs so that they can be used by beats as well.
It also makes a small change to the original code.
proxy-servernow writes the incoming headers first and then the status code.Why is it important?
Checklist
Related issues