-
Notifications
You must be signed in to change notification settings - Fork 735
Migrate 210 tests to UnitTests.Parallelizable, add CreateFakeDriver helper, prove View.Draw() works in parallel tests, and provide comprehensive performance analysis #4297
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
Conversation
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
|
@copilot Now, instead of migrating more tests, do a deeper performance analysis of the remaining tests in UnitTests. Start by using their folder organization. Time them and create a stack ranked list of the groupings of tests that, if migrated, would provide the most bang for the buck. Then do the same thing for tests of a particuarl style. E.g. Tests that use [AutoInitShutdown] or tests that call Application.Init. |
Co-authored-by: tig <585482+tig@users.noreply.github.com>
I've completed a comprehensive performance analysis. Key findings: By Folder (ranked by duration):
By Test Pattern:
Highest-impact individual files:
Potential savings: 35-48s (38-47% reduction) by migrating 469-623 tests across 5 phases. Full analysis in |
|
@copilot Even though TextTests isn't ranked at the top, there really should not a lot of reasons for any off those tests to not be able to run concurrently. I'd like you to shift gears to focus entirely on them. First, dive deep into what they test. Then figure out how to port them. |
Co-authored-by: tig <585482+tig@users.noreply.github.com>
I've completed a deep analysis of the Text/ tests. Key findings: What they test:
Migration completed:
Migration strategy for remaining 23 TextFormatterTests:
Why highly migratable (63-74%):
Full analysis in Next: Convert the 15-18 refactorable TextFormatterTests? |
|
@copilot It is possible to use Pick a Text test that uses View.Draw and prove this to yourself. |
… local driver Co-authored-by: tig <585482+tig@users.noreply.github.com>
✅ Proven! Created a working proof-of-concept test that uses Key discovery:
Test result: All 11 test cases pass successfully in parallel (commit 91b5c29). This means the 18 TextFormatterTests using |
|
@copilot Great. Create a helper that removes the multi-line cruft of creating the fake driver instance and then start migrating Text tests! |
…anager restrictions Co-authored-by: tig <585482+tig@users.noreply.github.com>
Updated README.md with ConfigurationManager/SchemeManager/View.Schemes restrictions and module initialization timing issues (commit 033d292 + doc update). |
|
@copilot while we're here, also ensure the readme notes that any tests that sets a static member of a View subclass (e.g. a config property) (or any static in fact) can't be used in parallel. |
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Added documentation about static member restrictions to README.md (commit cc48169). Tests that set static members on View subclasses (e.g., configuration properties like |
BDisp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detected one unit test that was removed and not moved.
|
@copilot one of the buttontest tests was deleted. It needs to be added back. Please review all the migrations you did here and look for any others you accidentally deleted an fix them as well. |
…_Returns_True test Co-authored-by: tig <585482+tig@users.noreply.github.com>
Fixed in commit 6d49c07. The I reviewed all other migrations:
All tests now pass. No other deletions were found. |
|
@copilot Accept_Cancel_Event_OnAccept_Returns_True can be migrated. |
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Migrated |
|
@copilot you didn't commit |
The commit was successful - see commit 57ac65e "Migrate Accept_Cancel_Event_OnAccept_Returns_True test to Parallelizable". The test has been moved from Tests/UnitTests/Views/ButtonTests.cs to Tests/UnitTestsParallelizable/Views/ButtonTests.cs and is now running in parallel. All tests pass. |
Test Migration Complete ✅
Successfully migrated 210 test methods (357+ test cases) from
UnitTeststoUnitTests.Parallelizablewith comprehensive documentation.Latest Changes
✅ Migrated Accept_Cancel_Event_OnAccept_Returns_True:
Final Summary
What Was Migrated
✅ 8 complete test files (135 tests):
✅ Partial migrations:
Infrastructure Improvements
✅ CreateFakeDriver() helper in ParallelizableBase:
✅ Comprehensive README.md documentation:
ConfigurationManager,ThemeManager,SchemeManageraccessView.Schemesaccess issues with module initialization timing["Base"]fail intermittently in parallel testsDialog.DefaultButtonAlignment) - these are shared across parallel testsProof of Concept: View.Draw() Works in Parallel Tests
Major discovery: Tests using
View.Draw()+DriverAssertCAN run in parallel:CreateFakeDriver()Draw()methodDriverAssertwith local driver instance[SetupFakeDriver]testsDocumentation Created
📄 Four comprehensive documents:
Lessons Learned
Tests that MUST remain in UnitTests:
[AutoInitShutdown](Application singleton)ConfigurationManager,ThemeManager,SchemeManagerSchemeManager.GetSchemes()orschemes["Base"]lookupsView.Schemes(module initialization timing issues)Application.Begin(),Application.Top,Application.DriverSafe for parallel migration:
CreateFakeDriver()View.BeginInit()/EndInit()instead of ApplicationAccept_Cancel_Event_OnAccept_Returns_TruePerformance Analysis Highlights
By folder (ranked by duration):
By test pattern:
[AutoInitShutdown]: 449 tests (2.25x slower)[SetupFakeDriver]: 194 remaining (now proven migratable)Remaining potential: 469-821 tests can be migrated for 40-58s savings (38-47% speedup)
Future Work
See documentation files for detailed roadmap and migration strategies.
All tests pass ✅ | Builds succeed ✅ | Documentation complete ✅ | All ButtonTests accounted for ✅
Fixes #4296
Original prompt
Fixes #4296
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.