-
Notifications
You must be signed in to change notification settings - Fork 773
Fixes #3956. Refactor unit test projects: rename UnitTests→Legacy, add NonParallelizable, eliminate Legacy tests #4845
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
eaf540d
Initial plan
Copilot 7b7d49b
Refactor tests: rename UnitTests to UnitTests.Legacy, add UnitTests.N…
Copilot b940474
Fix IntegrationTests.csproj: update project reference from UnitTests …
Copilot b6d58d6
Step 4 iteration 1: delete 37 Legacy test files already covered in Un…
Copilot 5e45e73
Step 4 iteration 2: delete 14 more Legacy test files covered in UnitT…
Copilot 14b2779
Step 4 iteration 3: delete 5 more Legacy test files (Config and TextV…
Copilot e8be9b4
Step 4 iteration 4: delete UICatalog tests, move ConfigurationManager…
Copilot 6ddab1b
Step 4 iteration 5: delete FrameViewTests (covered incidentally in Para)
Copilot 92abe47
Step 4 iteration 6: delete StatusBarTests (covered by BarTests in Para)
Copilot 18ea1bb
Fix code style: remove trailing whitespace and extra blank lines in N…
Copilot 095c357
Step 4 iteration 7: SpinnerViewTests - add minimal Para tests, delete…
Copilot 9ed6816
Step 4 iteration 8: TreeTableSourceTests - add 4 minimal Para tests, …
Copilot e28086f
Step 4 iteration 9: SynchronizatonContextTests - add 2 minimal NonPar…
Copilot 730cce2
Step 4 iteration 10: FileSystemCollectionNavigationMatcher tests - ad…
Copilot 3fe7b88
Step 4 iteration 11: delete TabViewTests from Legacy (TabView being r…
Copilot c82e0ca
Step 4 iteration 12: AppendAutocompleteTests - add 4 minimal Para tes…
Copilot f5c5866
Step 4 iteration 13: ProgressBarTests - add 4 minimal Para tests, del…
Copilot 799f338
Step 4 iteration 14: FileDialogTests - add 13 AllowedType Para tests,…
Copilot 37cdde7
Step 4 iteration 15: GraphViewTests - add 8 minimal Para tests, delet…
Copilot 282d1ab
Step 4 iteration 16: TableViewTests - add 15 minimal Para tests, dele…
Copilot 3863646
Fix CI: remove UnitTests.Legacy step from workflow (project now has 0…
Copilot 5c4d871
Update SynchronizationContextTests.cs
tig 86ee3e3
Update UnitTests.NonParallelizable.csproj
tig 8eea300
Update unit-tests.yml
tig 0323675
Update ConfigurationMangerTests.cs
tig a5e953d
Fix SynchronizationContextTests: use modern instance model (Applicati…
Copilot 36dad4e
Merge remote-tracking branch 'origin/v2_develop' into copilot/refacto…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # UnitTests.Legacy | ||
|
|
||
| This project contains tests that have not yet been ported to `UnitTestsParallelizable` or `UnitTests.NonParallelizable`. | ||
|
|
||
| **Do not add new tests here.** New tests should go in: | ||
| - [`../UnitTestsParallelizable`](../UnitTestsParallelizable/README.md) for tests with no static state dependency. | ||
| - [`../UnitTests.NonParallelizable`](../UnitTests.NonParallelizable/README.md) for tests that explicitly depend on process-wide static state. | ||
|
|
||
| Each test class in this project is a candidate for one of: | ||
| 1. **Rewrite** in the appropriate project if the case is not already covered. | ||
| 2. **Deletion** if the case is already covered in `UnitTestsParallelizable`. | ||
|
|
||
| See the [Testing wiki](https://github.com/gui-cs/Terminal.Gui/wiki/Testing) for details. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...plication/ApplicationModelFencingTests.cs → ...plication/ApplicationModelFencingTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d/ApplicationKeyboardThreadSafetyTests.cs → ...d/ApplicationKeyboardThreadSafetyTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...plication/Keyboard/KeyboardSetterTests.cs → ...plication/Keyboard/KeyboardSetterTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
Tests/UnitTests.NonParallelizable/Application/SynchronizationContextTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // Copilot | ||
| #nullable enable | ||
|
|
||
| namespace UnitTests.NonParallelizable.ApplicationTests; | ||
|
|
||
| /// <summary> | ||
| /// Tests for the <see cref="SynchronizationContext"/> that is set during the Terminal.Gui application lifecycle. | ||
| /// Must run non-concurrently because <see cref="IApplication.Init"/> and <see cref="IDisposable.Dispose"/> mutate | ||
| /// the process-wide <see cref="SynchronizationContext.Current"/>. | ||
| /// </summary> | ||
| public class SynchronizationContextTests | ||
| { | ||
| [Fact] | ||
| public void Init_SetsSynchronizationContext_Dispose_ClearsIt () | ||
| { | ||
| IApplication app = Application.Create (); | ||
|
|
||
| try | ||
| { | ||
| app.Init (DriverRegistry.Names.ANSI); | ||
|
|
||
| Assert.NotNull (SynchronizationContext.Current); | ||
| } | ||
| finally | ||
| { | ||
| app.Dispose (); | ||
| } | ||
|
|
||
| Assert.Null (SynchronizationContext.Current); | ||
| } | ||
|
|
||
| [Fact] | ||
| public void Init_SynchronizationContext_CreateCopy_ReturnsDifferentInstance () | ||
| { | ||
| IApplication app = Application.Create (); | ||
|
|
||
| try | ||
| { | ||
| app.Init (DriverRegistry.Names.ANSI); | ||
|
|
||
| SynchronizationContext context = SynchronizationContext.Current!; | ||
| SynchronizationContext copy = context.CreateCopy (); | ||
|
|
||
| Assert.NotNull (copy); | ||
| Assert.NotSame (context, copy); | ||
| } | ||
| finally | ||
| { | ||
| app.Dispose (); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| global using Attribute = Terminal.Gui.Drawing.Attribute; | ||
| global using Color = Terminal.Gui.Drawing.Color; | ||
| global using CM = Terminal.Gui.Configuration.ConfigurationManager; | ||
| global using Terminal.Gui.App; | ||
| global using Terminal.Gui.Time; | ||
| global using Terminal.Gui.Testing; | ||
| global using Terminal.Gui.Drivers; | ||
| global using Terminal.Gui.Input; | ||
| global using Terminal.Gui.Configuration; | ||
| global using Terminal.Gui.ViewBase; | ||
| global using Terminal.Gui.Views; | ||
| global using Terminal.Gui.Drawing; | ||
| global using Terminal.Gui.Text; | ||
| global using Terminal.Gui.Resources; | ||
| global using Terminal.Gui.FileServices; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.