Skip to content

Conversation

xuhongxu96
Copy link
Contributor

@xuhongxu96 xuhongxu96 commented Aug 12, 2025

Which Issue(s) This PR Fixes

Fixes #9609, #9542, #9102

Brief Description

We fixed the Bazel CI.
We also identified several redundant/unused dependencies in Bazel build scripts.

  • Upgrade Bazel to 6.5.0
  • Use JDK 8 by setting java_language_version and java_runtime_version along with local_java_repository instead of the deprecated arguments javabase, etc.
  • Pass a custom system property -Dbuild.bazel=true so that we can ignore test cases that cannot run in Bazel environment. E.g., getResource().GetPath() returns a path inside a JAR, which cannot be directly accessed. See client/src/test/java/org/apache/rocketmq/acl/common/AclUtilsTest.java.
  • Suppress DoubleBraceInitialization warnings to avoid compile errors.
  • Exclude the following tests temporarily (the first 2 don't run in maven build either):
    • //client:src/test/java/org/apache/rocketmq/client/impl/mqclient/MQClientAPITest
    • //proxy:src/test/java/org/apache/rocketmq/proxy/service/cert/TlsCertificateManagerTest
    • //store:src/test/java/org/apache/rocketmq/store/dledger/DLedgerMultiPathTest
  • Add the following tests as medium_tests:
    • //store:src/test/java/org/apache/rocketmq/store/timer/TimerMessageStoreTest
  • Copy changes from [ISSUE 9542] fix bazel compile #9543. Thanks @totalo!

Future Tasks

  • Test suites using JUnit 5 cannot be tested in Bazel.
  • Fix the excluded test cases.
  • Think of another way to conduct the test AclUtilsTest::testGetAclRPCHookByFileName

How Did You Test This Change?

Run bazel build and bazel test locally.

Also tested them in GitHub Actions (See https://github.com/xuhongxu96/rocketmq/actions/runs/16974096296).

@lizhimins
Copy link
Member

Can you help fix bazel's CI?

@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.94%. Comparing base (6d4fb83) to head (7f13e96).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #9610      +/-   ##
=============================================
- Coverage      48.14%   47.94%   -0.20%     
+ Complexity     12072    12030      -42     
=============================================
  Files           1313     1313              
  Lines          92793    92839      +46     
  Branches       11867    11870       +3     
=============================================
- Hits           44673    44513     -160     
- Misses         42625    42800     +175     
- Partials        5495     5526      +31     

☔ 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.

@xuhongxu96 xuhongxu96 changed the title refactor: reduce dependencies [ISSUE #9542, #9609] Fix bazel CI and reduce dependencies Aug 14, 2025
suppress DoubleBraceInitialization
@xuhongxu96
Copy link
Contributor Author

@lizhimins Finally, fixed CI...

@xuhongxu96
Copy link
Contributor Author

Hi @lizhimins, looks like all CI pipelines have passed. Any more comments on this PR?
Thanks.

@lizhimins lizhimins merged commit 7ab7ddd into apache:develop Aug 22, 2025
13 of 14 checks passed
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.

[Enhancement] Reduce redundant dependencies
4 participants