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

Cruise Control mock refactoring #10056

Merged
merged 5 commits into from
May 7, 2024
Merged

Cruise Control mock refactoring #10056

merged 5 commits into from
May 7, 2024

Conversation

fvaleri
Copy link
Contributor

@fvaleri fvaleri commented May 3, 2024

This is part of the refactoring mentioned in the RF change proposal. Next PRs: share CC client logic, replacing Vertx with Java HTTP client.

@fvaleri fvaleri added this to the 0.41.0 milestone May 3, 2024
@fvaleri fvaleri requested review from scholzj and ppatierno May 3, 2024 11:12
@fvaleri fvaleri changed the title Add Cruise Control abstract mock Cruise Control mock refactoring May 6, 2024
This is part of the refactoring mentioned in the RF change proposal.

Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

LGTM.

@fvaleri fvaleri requested a review from scholzj May 6, 2024 14:35
Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

Few more nits, but LGTM otherwise.

@@ -114,16 +121,26 @@ public static void beforeAll() {

vertx = Vertx.vertx();
sharedWorkerExecutor = vertx.createSharedWorkerExecutor("kubernetes-ops-pool");

// Configure Cruise Control mock
serverPort = CruiseControl.REST_API_PORT;
Copy link
Member

Choose a reason for hiding this comment

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

As you are changing this, would it make sense to change it everywhere the same way or not at all?

  • Here you create a static variable but assign it a fixed value
  • In KafkaRebalanceStateMachineTest you keep using CruiseControl.REST_API_PORT directly
  • In CruiseControlClientTest you seem to change it to using static variable and TestUtils.getFreePort() => this seems to me like the best variant

If you are alread changing it, it seems like it might make sense to change it the same way everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem with those tests is that they don't use the CC client directly, but through KafkaRebalanceAssemblyOperator where CC port is hard coded to CruiseControl.REST_API_PORT. I didn't changed it to keep the PR focused on tests, but I can do it if you prefer.

@scholzj
Copy link
Member

scholzj commented May 6, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
@fvaleri
Copy link
Contributor Author

fvaleri commented May 7, 2024

@scholzj I added one more small commit to share the basic auth value method, which was in the first commit, but not complete. Sorry.

Signed-off-by: Federico Valeri <fedevaleri@gmail.com>
@fvaleri fvaleri requested a review from scholzj May 7, 2024 12:21
@scholzj
Copy link
Member

scholzj commented May 7, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj scholzj merged commit c90f683 into strimzi:main May 7, 2024
21 checks passed
@fvaleri fvaleri deleted the cc-mock branch May 8, 2024 06:10
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.

None yet

3 participants