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

Improve HTTP tests #7847

Merged
merged 23 commits into from
Sep 27, 2023
Merged

Improve HTTP tests #7847

merged 23 commits into from
Sep 27, 2023

Conversation

GregoryTravis
Copy link
Contributor

Pull Request Description

  • simple-httpbin encodes response using the Content-encoding header value
  • Return sent body verbatim

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@GregoryTravis GregoryTravis added the CI: No changelog needed Do not require a changelog entry for this PR. label Sep 19, 2023
@GregoryTravis GregoryTravis marked this pull request as ready for review September 19, 2023 20:17
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title says "Improve HTTP tests" - I didn't know what to expected, but to my disappointment I don't see any simplification of the testing infrastructure. Setting it up still remains complicated and as a result (almost) nobody executes these tests locally.

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.text.StringEscapeUtils;

public class DummyHandler implements HttpHandler {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this class called DummyHandler?

@@ -8,6 +8,7 @@ import Standard.Base.Network.HTTP.Request_Body.Request_Body
import Standard.Base.Network.HTTP.Request_Error
import Standard.Base.Network.Proxy.Proxy
import Standard.Base.Runtime.Context
from Standard.Base.Network.HTTP import resolve_headers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is only executed if:

   ## To run this test locally:
       $ sbt 'simple-httpbin/run localhost 8080'
       $ export ENSO_HTTP_TEST_HTTPBIN_URL=http://localhost:8080/

Why don't we move the code from simple-httpbin into enso-test-java-helpers and let this Http_Spec start the server on its own?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a really cool idea indeed!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll break this out as a separate task.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GregoryTravis
Copy link
Contributor Author

@JaroslavTulach The purpose of this was not to improve the test infrastructure, but to provide better testing of Data.fetch and Data.drop.

@GregoryTravis
Copy link
Contributor Author

@JaroslavTulach Renamed DummyHandler to TestHandler.

}
}

private String parsseTextEncoding(String contentType) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private String parsseTextEncoding(String contentType) {
private String parseTextEncoding(String contentType) {

@GregoryTravis GregoryTravis added CI: Ready to merge This PR is eligible for automatic merge CI: Clean build required CI runners will be cleaned before and after this PR is built. labels Sep 26, 2023
@mergify mergify bot merged commit b037123 into develop Sep 27, 2023
24 checks passed
@mergify mergify bot deleted the wip/gmt/5105-better-tests branch September 27, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants