apache / apache/rocketmq

[Enhancement] Remove macOS platform skip logic from test cases to improve cross-platform compatibility

Open
#9,738 0 comments 0 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
2d 20h
Merged PRs (30d)
26

Description

### Before Creating the Enhancement Request

- [x] I have confirmed that this should be classified as an enhancement rather than a bug/feature.

### Summary

Remove macOS platform detection and skip logic from test cases to enable full test coverage on macOS platform, improving cross-platform compatibility and ensuring consistent testing behavior across different operating systems.

### Motivation

Currently, many test cases in the RocketMQ project contain platform-specific skip logic that prevents tests from running on macOS systems. This creates several issues:
Incomplete Test Coverage: Tests are skipped on macOS, reducing overall test coverage and potentially missing platform-specific issues
Developer Experience: macOS developers cannot run the full test suite locally, making it difficult to verify changes before submitting PRs
CI/CD Inconsistency: Different platforms may have different test execution paths, leading to inconsistent CI/CD behavior
Maintenance Overhead: Platform-specific code adds complexity and requires ongoing maintenance

### Describe the Solution You'd Like

Remove all macOS platform skip logic from test cases by:
Remove Platform Detection Calls: Eliminate Assume.assumeFalse(MixAll.isMac()) calls from test methods
Remove Conditional Logic: Remove if (MixAll.isMac()) { return; } conditions in setUp/tearDown methods
Clean Up Imports: Remove unused imports like org.junit.Assume and org.apache.rocketmq.common.MixAll
Update Test Logic: Modify any platform-specific test logic to work universally

### Describe Alternatives You've Considered

Alternative 1: Conditional Test Execution
Keep platform detection but make it configurable
Why rejected: Still creates platform-specific behavior and doesn't solve the core issue of incomplete test coverage
Alternative 2: Platform-Specific Test Suites
Create separate test suites for different platforms
Why rejected: Increases maintenance complexity and doesn't address the need for unified testing
Alternative 3: Mock Platform Detection
Mock the platform detection to always return false
Why rejected: Doesn't address the root cause and may hide real platform-specific issues
Alternative 4: Gradual Migration
Remove skip logic incrementally over multiple PRs
Why rejected: The current approach of removing all skip logic at once is more efficient and provides immediate benefits
The chosen solution of completely removing macOS skip logic is the most effective because it:
Provides immediate full test coverage on macOS
Simplifies test code by removing platform-specific conditions
Ensures consistent behavior across all platforms
Reduces maintenance overhead

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.