Skip to content

Conversation

@JasonXuDeveloper
Copy link
Owner

Summary

  • Add comprehensive unit tests for JEngine.Util async infrastructure (JActionAwaiter, JActionExecutionHandle)
  • Add tests for JEngine.UI form components (JDropdown, JObjectField, JTextField)
  • Add tests for EditorUIRegistration handler verification
  • Add real MessageBox prefab tests with new SkipDontDestroyOnLoad test hook

Test plan

  • All EditMode tests pass
  • Code coverage increases for JEngine.Util.JActionAwaiter
  • Code coverage increases for JEngine.UI.MessageBox
  • Code coverage increases for JEngine.UI.Editor.Internal.EditorUIRegistration

🤖 Generated with Claude Code

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>
@github-actions
Copy link

github-actions bot commented Feb 1, 2026

Unity Test Results

EditMode: All tests passed
PlayMode: All tests passed

Unity Version: 2022.3.55f1
Project Path: UnityProject

✅ All tests passed! The PR is ready for review.

View workflow run

Click here to view the full workflow run

Copy link

Copilot AI left a 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 / JActionExecutionHandle async infrastructure.
  • Expand UI EditMode tests for form controls (JDropdown, JObjectField, JTextField) and EditorUIRegistration handler registration.
  • Add MessageBox.SkipDontDestroyOnLoad test hook + new “real prefab” MessageBox tests.

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.

@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

❌ Patch coverage is 99.24718% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.08%. Comparing base (05a92f8) to head (0868ea3).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
ui 93.04% <98.96%> (+9.44%) ⬆️
util 93.19% <99.40%> (+2.82%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

- 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>
Copy link

@github-actions github-actions bot left a 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).

github-actions[bot]
github-actions bot previously approved these changes Feb 1, 2026
Copy link

@github-actions github-actions bot left a 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>
Copy link

Copilot AI left a 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.

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>
Copy link
Owner Author

@JasonXuDeveloper JasonXuDeveloper left a 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.

Copy link
Owner Author

@JasonXuDeveloper JasonXuDeveloper left a 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.

Copy link
Owner Author

@JasonXuDeveloper JasonXuDeveloper left a 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.

Copy link
Owner Author

@JasonXuDeveloper JasonXuDeveloper left a 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.

Copy link

Copilot AI left a 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.

@JasonXuDeveloper JasonXuDeveloper enabled auto-merge (squash) February 1, 2026 10:08
Copy link

Copilot AI left a 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.

@JasonXuDeveloper JasonXuDeveloper merged commit 2ea9238 into master Feb 1, 2026
38 checks passed
@JasonXuDeveloper JasonXuDeveloper deleted the test/improve-coverage branch February 1, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants