Skip to content

Integration tests #6705

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

Draft
wants to merge 9 commits into
base: dev-2.x
Choose a base branch
from

Conversation

leonardehrenfried
Copy link
Member

@leonardehrenfried leonardehrenfried commented Jun 18, 2025

Summary

As discussed I'm adding an integration test module that checks that Apache HTTP Client still works with the latest version of the code. It is run, when a pull request has the label "Integration Test".

Unit tests

Yes :)

Copy link

codecov bot commented Jun 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.64%. Comparing base (1ee5176) to head (b564538).
Report is 2 commits behind head on dev-2.x.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6705      +/-   ##
=============================================
- Coverage      71.65%   71.64%   -0.01%     
  Complexity     18967    18967              
=============================================
  Files           2061     2061              
  Lines          77570    77570              
  Branches        7913     7913              
=============================================
- Hits           55579    55576       -3     
- Misses         19163    19165       +2     
- Partials        2828     2829       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

* This integration test makes sure that Apache HTTP client still works with important hosts and
* HTTP servers.
*/
class OtpHttpClientTest {
Copy link
Member

Choose a reason for hiding this comment

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

I think @t2gran suggested the postfix for integration tests could be IntegrationTest.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could use the (admittedly pretty dusty) integration test feature of maven (via the failsafe plugin) or use the tags to select just these tests, like we do with @GeneratesDocumentation. Do you have an opinion?

var stream = OTP_HTTP_CLIENT.getAsInputStream(uri, Duration.ofSeconds(30), Map.of());
var bytes = IOUtils.toByteArray(stream);

assertNotEquals(0, bytes.length, "Empty response body for %s".formatted(url));
Copy link
Member

Choose a reason for hiding this comment

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

Is the symptom of a HTTP client problem always an empty body?

Copy link
Member Author

Choose a reason for hiding this comment

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

In the examples used in this test, yes.

I'm mainly testing that general HTTP calls don't throw an exception, which they did for two previous version upgrades.

@leonardehrenfried leonardehrenfried marked this pull request as draft June 26, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants