-
Notifications
You must be signed in to change notification settings - Fork 340
test(ui): add comprehensive tests for PanelUI and BootstrapEditorUI #612
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 unit tests for internal UI editor classes:
- PanelUITests: tests for JEngine Panel build configuration UI
- BootstrapEditorUITests: tests for Bootstrap inspector UI
Integration tests (Build All, Build Assets Only with XOR/AES/ChaCha20):
- Marked with [Category("Integration")] for separate execution
- Test real build functionality against active build target
Test infrastructure improvements:
- JEngineTestBase: base class with LogAssert.ignoreFailingMessages
- TestsSetUp: assembly-level setup to disable auto-baking
- AssemblyInfo.cs: InternalsVisibleTo for test assembly access
BuildManager improvements:
- Simplified error filtering with unified IgnoredErrors array
- Added "Bake Ambient Probe" to ignored errors (Unity lighting issue)
- Added "catalog file failed" to ignored errors (YooAsset bug)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
The SetUpFixture doesn't prevent "Bake Ambient Probe" errors since they come from Unity's BuildPipeline, not scene creation. JEngineTestBase already handles error suppression per-test via LogAssert.ignoreFailingMessages. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Unity Test Results✅ EditMode: All tests passed Unity Version: 2022.3.55f1 ✅ All tests passed! The PR is ready for review. View workflow run |
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
This PR adds comprehensive test coverage for internal UI editor classes (PanelUI and BootstrapEditorUI) and improves the BuildManager's error filtering to handle Unity internal errors more gracefully.
Changes:
- Added test infrastructure with
JEngineTestBaseandTestsSetUpto handle Unity internal errors during tests - Added 690 lines of tests for
PanelUIincluding 4 integration tests that verify actual build operations - Added 561 lines of tests for
BootstrapEditorUIcovering UI creation, encryption configs, and undo/redo behavior - Unified error filtering in BuildManager to handle both "Bake Ambient Probe" and "catalog file failed" errors consistently
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
TestsSetUp.cs |
Assembly-level setup that disables auto-baking to reduce Unity lighting errors |
JEngineTestBase.cs |
Base test class that suppresses Unity internal errors via LogAssert.ignoreFailingMessages |
MessageBoxTests.cs |
Migrated to use JEngineTestBase for consistent error handling |
PanelUITests.cs |
Comprehensive tests for PanelUI including 4 integration tests for build operations |
BootstrapEditorUITests.cs |
Comprehensive tests for BootstrapEditorUI covering all UI sections and configurations |
AssemblyInfo.cs |
Adds InternalsVisibleTo for test assembly access to internal classes |
JEngine.UI.Editor.Tests.asmdef |
Added JEngine.Core and JEngine.Core.Editor references |
BuildManager.cs |
Unified error filtering with IgnoredErrors array for maintainability |
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/JEngineTestBase.cs
Outdated
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/JEngineTestBase.cs
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/PanelUITests.cs
Outdated
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/PanelUITests.cs
Outdated
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/PanelUITests.cs
Show resolved
Hide resolved
UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/PanelUITests.cs
Outdated
Show resolved
Hide resolved
...ect/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/BootstrapEditorUITests.cs
Outdated
Show resolved
Hide resolved
...ect/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/BootstrapEditorUITests.cs
Outdated
Show resolved
Hide resolved
...ect/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/BootstrapEditorUITests.cs
Outdated
Show resolved
Hide resolved
...ect/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/BootstrapEditorUITests.cs
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #612 +/- ##
==========================================
+ Coverage 85.01% 90.02% +5.00%
==========================================
Files 60 63 +3
Lines 7683 8350 +667
==========================================
+ Hits 6532 7517 +985
+ Misses 1151 833 -318
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
- JEngineTestBase: save and restore LogAssert.ignoreFailingMessages state - JEngineTestBase: add XML documentation for virtual methods - PanelUITests: remove unused _panel field and cleanup code - PanelUITests: use discard pattern for unused root assignments - BootstrapEditorUITests: use discard pattern for unused root assignments - BuildManager: use LINQ Any() for IsIgnoredError filtering 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.
Auto-approved: Copilot review found no issues and Unity Tests passed (or were skipped for non-code changes).
Summary
PanelUIandBootstrapEditorUI)Test Coverage
PanelUITests
[Category("Integration")]):BuildAllButton_Click_CompletesSuccessfully- main packageBuildAssetsOnly_Addon1_Xor_CompletesSuccessfullyBuildAssetsOnly_Addon1_Aes_CompletesSuccessfullyBuildAssetsOnly_Addon1_ChaCha20_CompletesSuccessfullyBootstrapEditorUITests
Test Infrastructure
JEngineTestBase: Base class withLogAssert.ignoreFailingMessagesto suppress Unity internal errorsTestsSetUp: Assembly-level setup to disable auto-baking (Lightmapping.giWorkflowMode = OnDemand)AssemblyInfo.cs:InternalsVisibleToattribute for test assembly access to internal classesBuildManager Improvements
IgnoredErrorsarray for consistent error filteringTest plan
🤖 Generated with Claude Code