Skip to content

Conversation

mcruzdev
Copy link
Contributor

@mcruzdev mcruzdev commented Mar 27, 2025

Description

Please explain the changes you've made

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@salaboy
Copy link
Collaborator

salaboy commented Mar 29, 2025

@mcruzdev what's the idea here? just to replicate the same tests (the flaky one) but with Testcontainers and Toxiproxy managed by testcontainers?

@mcruzdev
Copy link
Contributor Author

@mcruzdev what's the idea here? just to replicate the same tests (the flaky one) but with Testcontainers and Toxiproxy managed by testcontainers?

The idea is to use Testcontainers and to test in a different way.

@salaboy
Copy link
Collaborator

salaboy commented Mar 29, 2025

As soon as it test the same thing, we can use this to create a plan to move all tests to use test containers

@mcruzdev
Copy link
Contributor Author

As soon as it test the same thing, we can use this to create a plan to move all tests to use test containers

I changed the test to be more specific, testing each configuration separated.

@mcruzdev mcruzdev changed the title Add first structure for Resiliency tests Remove flaky test using Testcontainers and a more specific test approach Mar 29, 2025
@mcruzdev mcruzdev marked this pull request as ready for review March 29, 2025 17:37
@mcruzdev mcruzdev requested review from a team as code owners March 29, 2025 17:37
@mcruzdev mcruzdev force-pushed the issue-1258 branch 3 times, most recently from 7d5fa66 to 928feb5 Compare March 31, 2025 20:43
@salaboy
Copy link
Collaborator

salaboy commented Apr 1, 2025

@artur-ciocanu did you had time to check this out? This is definitely our first step to move our integration tests to testcontainers .. and it is looking really good IMO. Do you have any concerns about this ?

@cicoyle
Copy link
Contributor

cicoyle commented Apr 1, 2025

@artur-ciocanu did you had time to check this out? This is definitely our first step to move our integration tests to testcontainers .. and it is looking really good IMO. Do you have any concerns about this ?

I agree, this is a great start and will be great in the long run for standardization across IT tests.

@salaboy - Please cc the listed java approvers + maintainers for input as opposed to individual GH handles, as that way, when we add more approvers and maintainers we don't leave anyone out.

@cicoyle cicoyle added this to the v1.15 milestone Apr 1, 2025
Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

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

@mcruzdev awesome work, love it! I have left some comments could you please address them and I'll take another look.

Thank you ❤️

import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching;
import static com.github.tomakehurst.wiremock.client.WireMock.verify;
import static io.dapr.it.resiliency.SdkResiliencyIT.WIREMOCK_PORT;
import static io.dapr.it.testcontainers.DaprContainerConstants.IMAGE_TAG;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use a simpler import like:

import static org.assertj.core.api.Assertions.assertThat;

private String appName;
private Integer appPort;
private String appHealthCheckPath;
private boolean shouldReusePlacement;
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not clear, why we need this change. As far as I saw in the IT tests, the network alias is not required. I am not against enhancing DaprContainer with network alias, but I think it can be done in a separate PR where we could explain what is the use case and probably and a few unit tests to improve coverage.

Copy link
Contributor Author

@mcruzdev mcruzdev Apr 7, 2025

Choose a reason for hiding this comment

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

It is necessary because the Toxiproxy container needs to communicate with Dapr in the same network, it is more easy to do with aliases;

Copy link
Contributor

Choose a reason for hiding this comment

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

@mcruzdev I see that you are using .withNetwork(NETWORK) for ToxiproxyContainer, hence my question regarding network alias.

As I mentioned we can add support for network alias in a separate PR and add the necessary code coverage to DaprContainer. Once we have support for network alias we can revisit this IT and use network alias instead of network.

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 got it, I changed the code :)

@salaboy
Copy link
Collaborator

salaboy commented Apr 2, 2025

@cicoyle how do you do that ? Meaning mentioning all maintainers ?

@cicoyle
Copy link
Contributor

cicoyle commented Apr 2, 2025

@cicoyle how do you do that ? Meaning mentioning all maintainers ?

yes, as I want to ensure the appropriate folk are not left out. Here are the tags for the appropriate community members in this SDK: @dapr/approvers-java-sdk and @dapr/maintainers-java-sdk.

But tagging is not necessary immediately after opening PRs and issues bc those groups already get emails about it bc approvers and maintainers are already listed as reviewers automatically
image

I would say tagging is more for after a day or more goes by without review or input.

@salaboy
Copy link
Collaborator

salaboy commented Apr 7, 2025

@mcruzdev ok.. it seems that only codecov is missing, this is quite important so we can maintain the coverage over time. Can you check the report and see if you can cover more paths to get over the line?

@mcruzdev mcruzdev force-pushed the issue-1258 branch 3 times, most recently from 04745f3 to acba370 Compare April 7, 2025 17:03
artur-ciocanu
artur-ciocanu previously approved these changes Apr 7, 2025
Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

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

@mcruzdev thanks for addressing all the comments, it looks great!

Signed-off-by: Matheus Cruz <[email protected]>
@cicoyle cicoyle merged commit 8cb8099 into dapr:master Apr 7, 2025
8 of 9 checks passed
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.47%. Comparing base (d759c53) to head (2d4cbe1).
Report is 125 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1288      +/-   ##
============================================
- Coverage     76.91%   75.47%   -1.44%     
- Complexity     1592     1616      +24     
============================================
  Files           145      193      +48     
  Lines          4843     5101     +258     
  Branches        562      555       -7     
============================================
+ Hits           3725     3850     +125     
- Misses          821      935     +114     
- Partials        297      316      +19     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

4 participants