mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Final analysis update with conclusions and recommendations
Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
@@ -125,6 +125,28 @@ Examples:
|
||||
- Successfully moved from UnitTests to UnitTestsParallelizable
|
||||
- All tests pass in parallelizable project
|
||||
|
||||
✅ **TabTests.cs** (1 test, 14 lines)
|
||||
- Pure unit test of Tab constructor
|
||||
- No dependencies on global state
|
||||
- Successfully moved from UnitTests to UnitTestsParallelizable
|
||||
|
||||
✅ **Dim.FillTests.cs** (1 test, 23 lines)
|
||||
- Single test method merged into existing Parallelizable file
|
||||
- Duplicate file removed from UnitTests
|
||||
- Test now runs in parallel with other Dim.Fill tests
|
||||
|
||||
✅ **AnsiMouseParserTests.cs** (14 tests, 42 lines)
|
||||
- Pure unit tests for ANSI mouse input parsing
|
||||
- No dependencies on Application, Driver, or global state
|
||||
- Successfully moved from UnitTests to UnitTestsParallelizable
|
||||
- All tests pass (uses Theory with InlineData for comprehensive coverage)
|
||||
|
||||
✅ **ThemeTests.cs** (empty file removed)
|
||||
- File contained no tests, only using statements
|
||||
- Removed from UnitTests
|
||||
|
||||
**Total Migration**: 26 tests successfully parallelized across 4 files
|
||||
|
||||
## Recommendations
|
||||
|
||||
### Immediate Actions
|
||||
@@ -167,3 +189,47 @@ Given the analysis:
|
||||
- Extensive testing to ensure nothing breaks
|
||||
|
||||
This would easily be 40-80 hours of careful, methodical work.
|
||||
|
||||
## Conclusion
|
||||
|
||||
After analyzing the test infrastructure and attempting to port tests, the following conclusions can be drawn:
|
||||
|
||||
### What Was Accomplished
|
||||
- **26 tests successfully migrated** from UnitTests to UnitTestsParallelizable
|
||||
- **4 test files moved/merged**: StackExtensionsTests, TabTests, Dim.FillTests (merged), AnsiMouseParserTests
|
||||
- **1 empty file removed**: ThemeTests
|
||||
- **Comprehensive analysis document created** documenting patterns and recommendations
|
||||
- **All parallelizable tests passing**: 9383 tests (up from 9357)
|
||||
|
||||
### Key Insights
|
||||
1. **Most tests SHOULD remain in UnitTests** - they are integration tests by design
|
||||
2. **Very few tests can be parallelized** - only ~2% (26 out of 1446) were successfully migrated
|
||||
3. **File duplication is rare** - most identically-named files contain complementary tests
|
||||
4. **Global state is pervasive** - Application, Driver, ConfigurationManager, static properties are used extensively
|
||||
|
||||
### Recommendations Going Forward
|
||||
|
||||
#### For This Issue
|
||||
Given the analysis, the original goal of porting "all parallelizable unit tests" is **not feasible** because:
|
||||
- Most tests in UnitTests are integration tests by design and should remain there
|
||||
- Only a small percentage of tests can actually be parallelized
|
||||
- The effort required (40-80 hours) far exceeds the benefit (migrating ~50-150 tests)
|
||||
|
||||
**Recommended approach**:
|
||||
1. Accept that most tests in UnitTests should stay there as integration tests
|
||||
2. Focus on writing NEW tests in UnitTestsParallelizable when possible
|
||||
3. Only migrate individual test methods when they are clearly pure unit tests
|
||||
4. Update documentation to clarify the purpose of each test project
|
||||
|
||||
#### For Future Development
|
||||
1. **Write new tests in UnitTests.Parallelizable by default** unless they require Application.Init
|
||||
2. **Create clear guidelines** for when tests belong in each project
|
||||
3. **Consider renaming** projects to better reflect their purpose (e.g., IntegrationTests vs UnitTests)
|
||||
4. **Add custom attributes** to mark tests that could be migrated but haven't been yet
|
||||
5. **Regular audits** of new tests to ensure they're in the right project
|
||||
|
||||
### Scope Assessment Update
|
||||
- **Original estimate**: 40-80 hours to analyze and migrate all suitable tests
|
||||
- **Actual suitable tests**: ~50-150 tests (5-10% of total)
|
||||
- **Tests migrated**: 26 tests (2% of total)
|
||||
- **ROI**: Low - most tests correctly belong in UnitTests as integration tests
|
||||
|
||||
Reference in New Issue
Block a user