Skip to content

Fixing http entity test case#12668

Closed
cryptoe wants to merge 0 commit intoapache:masterfrom
cryptoe:http_entity_remote
Closed

Fixing http entity test case#12668
cryptoe wants to merge 0 commit intoapache:masterfrom
cryptoe:http_entity_remote

Conversation

@cryptoe
Copy link
Copy Markdown
Contributor

@cryptoe cryptoe commented Jun 17, 2022

Description

Fixes the unit test HttpEntity which was contacting https://druid.apache.org/data/wikipedia.json.gz. Changed it in a way that a local server gets started in the unit test and shuts down when the UT is finished.

The uber goal was to fix #10853 but that is tricky as it would require a new Nginx docker image to be bundled to serve static contents.
Will defer it until #12368 makes it into master.


Key changed/added classes in this PR
  • HttpEntityTest

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@kfaraz
Copy link
Copy Markdown
Contributor

kfaraz commented Jun 17, 2022

@cryptoe , I agree that it is weird to contact the ASF served druid.apache.org/wikipedia but I am not entirely sure if starting a local server in a unit test is the right solution for this.

Would it be possible to do this through a mock or through a file uri rather than an http endpoint?

@cryptoe cryptoe closed this Jun 17, 2022
@cryptoe cryptoe force-pushed the http_entity_remote branch from 4640f10 to 893759d Compare June 17, 2022 13:15
@cryptoe
Copy link
Copy Markdown
Contributor Author

cryptoe commented Jun 17, 2022

Raised a different PR : #12671

@cryptoe
Copy link
Copy Markdown
Contributor Author

cryptoe commented Jun 17, 2022

@cryptoe , I agree that it is weird to contact the ASF served druid.apache.org/wikipedia but I am not entirely sure if starting a local server in a unit test is the right solution for this.

Would it be possible to do this through a mock or through a file uri rather than an http endpoint?

In this case, mocking does not actually test anything hence went ahead with the file based approach.
Thanks for the review @kfaraz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The inputSource integration test is flaky

2 participants