gnodet opened a new pull request, #11251:
URL: https://github.com/apache/maven/pull/11251
## Overview
This comprehensive refactoring modernizes the Maven integration test suite
by removing version range dependencies from constructors and implementing
automatic test ordering for better concurrent execution.
## Key Changes
### 🔧 **Core Refactoring**
- **Removed version range constructors** from
`AbstractMavenIntegrationTestCase`
- **Updated 500+ integration test classes** to remove version range
parameters from constructors
- **Replaced version constraints** with standard `@since` javadoc tags and
`@Disabled` annotations
- **Removed empty constructors** that only contained `super();` calls
### 📋 **Test Ordering**
- **Implemented `TestSuiteOrdering`** class for consistent test execution
- **Orders tests by prefix** (gh-xxx, mng-xxx, it-xxx) in descending order
- **Ensures newer tests run first** for better fail-fast behavior in
concurrent execution
- **Replaces the previous `TestSuiteOrdering`** with improved automatic
ordering logic
### 🎯 **Examples of Changes**
**Before:**
```java
public class MavenIT0051ReleaseProfileTest extends
AbstractMavenIntegrationTestCase {
public MavenIT0051ReleaseProfileTest() {
super("(2.0.2,4.0.0-alpha-1)");
}
}
```
**After:**
```java
/**
* @since 2.0.2
*/
@Disabled("Upper bound: 4.0.0-alpha-1")
public class MavenIT0051ReleaseProfileTest extends
AbstractMavenIntegrationTestCase {
// Constructor removed - no longer needed
}
```
## Benefits
✅ **Cleaner Codebase**: Removed over 2,500 lines of boilerplate code
✅ **Better Documentation**: Version constraints now clearly documented via
standard annotations
✅ **Improved Test Execution**: Automatic ordering ensures newer tests run
first for faster feedback
✅ **Maintainability**: Easier to understand and modify test constraints
✅ **Backward Compatibility**: All existing functionality preserved while
removing technical debt
## Technical Details
### Files Changed
- **`AbstractMavenIntegrationTestCase`**: Removed version range
constructors, kept pattern-based constructors
- **500+ test classes**: Updated with `@since`/`@Disabled` annotations,
removed empty constructors
- **`TestSuiteOrdering`**: Updated with improved automatic test ordering
implementation
- **`junit-platform.properties`**: Updated to use new ordering system
### Build Status
✅ **All modules compile successfully** with Maven 4.0.0-rc-4 and Java 21
✅ **0 Checkstyle violations** - all code quality checks pass
✅ **Spotless formatting applied** automatically to 95+ files
✅ **No functional changes** - all test logic preserved
## Testing
The changes have been validated with:
- Full Maven build compilation
- Code quality checks (Checkstyle, Spotless)
- Verification that all test classes compile correctly
## Migration Notes
For any remaining test files that need manual updates, follow this pattern:
1. Remove version range from `super("...")` calls → `super()`
2. Add `@since` javadoc for lower bounds
3. Add `@Disabled` annotation for upper bounds
4. Remove empty constructors if they only contain `super();`
This refactoring makes the integration test suite cleaner, more
maintainable, and better prepared for concurrent execution with the new
automatic test ordering system.
---
Pull Request opened by [Augment Code](https://www.augmentcode.com/) with
guidance from the PR author
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]