-
Notifications
You must be signed in to change notification settings - Fork 340
test(ui,util): improve code coverage #614
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
Add comprehensive tests to improve code coverage: JEngine.Util: - JActionAwaiterTests: tests for JActionAwaitable and JActionAwaiter - JActionExecutionHandleTests: tests for JActionExecutionHandle, JActionExecutionAwaiter, and JActionExecution structs - JActionNestedExecutionTests: tests for sequential, parallel, and cancellation scenarios JEngine.UI: - EditorUIRegistrationTests: verify handler registration - MessageBoxTests: add real prefab tests using new SkipDontDestroyOnLoad test hook for EditMode compatibility - JDropdownTests: add formatter, edge case, and ForEnum tests - JObjectFieldTests: add panel attachment and BindProperty tests - JTextFieldTests: add panel attachment, placeholder, and edge case tests Also adds SkipDontDestroyOnLoad test hook to MessageBox to enable EditMode testing without DontDestroyOnLoad errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
90cd0cf to
6709589
Compare
Unity Test Results✅ EditMode: All tests passed Unity Version: 2022.3.55f1 ✅ All tests passed! The PR is ready for review. View workflow run |
...oject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionExecutionHandleTests.cs
Fixed
Show fixed
Hide fixed
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.
Pull request overview
Adds new EditMode unit tests to increase coverage for JEngine.Util async execution primitives and JEngine.UI editor/runtime UI components, including prefab-backed MessageBox behavior in EditMode.
Changes:
- Add extensive EditMode tests for
JActionAwaiter/JActionExecutionHandleasync infrastructure. - Expand UI EditMode tests for form controls (
JDropdown,JObjectField,JTextField) andEditorUIRegistrationhandler registration. - Add
MessageBox.SkipDontDestroyOnLoadtest hook + new “real prefab”MessageBoxtests.
Reviewed changes
Copilot reviewed 45 out of 80 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| UnityProject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionExecutionHandleTests.cs | New EditMode tests for JActionExecutionHandle / JActionExecutionAwaiter / JActionExecution. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionAwaiterTests.cs | New EditMode tests for JActionAwaitable / JActionAwaiter and nested/parallel patterns. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/MessageBoxTests.cs | Adds real-prefab MessageBox tests and toggles new EditMode test hook. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/EditorUIRegistrationTests.cs | New tests asserting editor handler registration wiring. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JTextFieldTests.cs | Adds additional edge-case/composition tests. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JObjectFieldTests.cs | Adds additional composition/BindProperty-related tests. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JDropdownTests.cs | Adds additional formatter/edge-case/composition tests. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Runtime/MessageBox.cs | Adds SkipDontDestroyOnLoad to make prefab-backed EditMode tests possible. |
...oject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionExecutionHandleTests.cs
Show resolved
Hide resolved
...oject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionExecutionHandleTests.cs
Outdated
Show resolved
Hide resolved
...oject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionExecutionHandleTests.cs
Outdated
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionAwaiterTests.cs
Outdated
Show resolved
Hide resolved
...ect/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JTextFieldTests.cs
Show resolved
Hide resolved
.../Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/EditorUIRegistrationTests.cs
Outdated
Show resolved
Hide resolved
.../Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/EditorUIRegistrationTests.cs
Outdated
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/MessageBoxTests.cs
Outdated
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/MessageBoxTests.cs
Outdated
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/MessageBoxTests.cs
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #614 +/- ##
==========================================
+ Coverage 85.01% 93.08% +8.06%
==========================================
Files 60 68 +8
Lines 7683 9480 +1797
==========================================
+ Hits 6532 8824 +2292
+ Misses 1151 656 -495
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
- Convert sync [Test] to [UnityTest] with await for ExecuteAsync tests - Rename misleading test names to match assertions - Remove handler invocation tests with poor error handling - Use discard for intentionally unused task variables Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
...oject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionExecutionHandleTests.cs
Fixed
Show fixed
Hide fixed
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.
Auto-approved: Copilot review found no issues and Unity Tests passed (or were skipped for non-code changes).
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.
Auto-approved: Copilot review found no issues and Unity Tests passed (or were skipped for non-code changes).
Use 'using var' pattern consistently to ensure JAction is properly disposed even if ExecuteAsync() throws an exception. This addresses the code scanning alert about Dispose not being called on exception. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
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.
Pull request overview
Copilot reviewed 45 out of 80 changed files in this pull request and generated 4 comments.
UnityProject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionAwaiterTests.cs
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.util/Tests/Editor/JActionAwaiterTests.cs
Outdated
Show resolved
Hide resolved
Add 5-second timeouts to UniTask.WaitUntil calls to prevent tests from hanging indefinitely if there's a regression. Uses CancellationTokenSource with timeout for deterministic failure behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
JasonXuDeveloper
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.
Fixed in commit cdddf14: Changed to use using var pattern consistently to ensure JAction is properly disposed even if ExecuteAsync() throws an exception.
JasonXuDeveloper
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.
Fixed in commit 0868ea3: Added 5-second timeouts to all UniTask.WaitUntil calls using CancellationTokenSource for deterministic failure behavior.
JasonXuDeveloper
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.
These YooAsset bundle changes are intentional - they contain the latest built assets needed for standalone mode testing. The user specifically requested these be included in the PR.
JasonXuDeveloper
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.
The HybridCLR link.xml changes were generated as part of the build process and are necessary for the runtime to work correctly. These preserve types used by the test infrastructure.
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.
Pull request overview
Copilot reviewed 45 out of 80 changed files in this pull request and generated 1 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.
Pull request overview
Copilot reviewed 45 out of 80 changed files in this pull request and generated 1 comment.
Summary
SkipDontDestroyOnLoadtest hookTest plan
🤖 Generated with Claude Code