Skip to content

Conversation

@JasonXuDeveloper
Copy link
Owner

Summary

  • Add comprehensive unit tests for internal UI editor classes (PanelUI and BootstrapEditorUI)
  • Add integration tests for build functionality (Build All, Build Assets Only with all encryption methods)
  • Improve BuildManager error filtering to handle Unity internal errors gracefully

Test Coverage

PanelUITests

  • UI creation and section tests
  • Build button existence and behavior
  • Status bar and log view tests
  • Toggle, dropdown, and encryption config tests
  • Package-specific tests (main vs addon1)
  • Integration tests (marked with [Category("Integration")]):
    • BuildAllButton_Click_CompletesSuccessfully - main package
    • BuildAssetsOnly_Addon1_Xor_CompletesSuccessfully
    • BuildAssetsOnly_Addon1_Aes_CompletesSuccessfully
    • BuildAssetsOnly_Addon1_ChaCha20_CompletesSuccessfully

BootstrapEditorUITests

  • UI creation and section tests
  • JToggleButton and JToggle tests
  • Dropdown tests
  • Encryption config tests for all 3 methods
  • Undo/Redo behavior tests
  • Target platform tests

Test Infrastructure

  • JEngineTestBase: Base class with LogAssert.ignoreFailingMessages to suppress Unity internal errors
  • TestsSetUp: Assembly-level setup to disable auto-baking (Lightmapping.giWorkflowMode = OnDemand)
  • AssemblyInfo.cs: InternalsVisibleTo attribute for test assembly access to internal classes

BuildManager Improvements

  • Unified IgnoredErrors array for consistent error filtering
  • Added "Bake Ambient Probe" to ignored errors (Unity lighting system issue)
  • Added "catalog file failed" to ignored errors (YooAsset bug during HybridCLR generation)

Test plan

  • All unit tests pass in EditMode
  • Integration tests complete successfully (builds main and addon1 packages)
  • No regressions in existing tests

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings February 1, 2026 02:09
@JasonXuDeveloper JasonXuDeveloper enabled auto-merge (squash) February 1, 2026 02:10
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>
@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

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 JEngineTestBase and TestsSetUp to handle Unity internal errors during tests
  • Added 690 lines of tests for PanelUI including 4 integration tests that verify actual build operations
  • Added 561 lines of tests for BootstrapEditorUI covering 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

@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

❌ Patch coverage is 96.85157% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.02%. Comparing base (05a92f8) to head (0cc8383).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
ui 89.94% <96.85%> (+6.33%) ⬆️
util 90.36% <ø> (ø)

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.

- 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>
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).

@JasonXuDeveloper JasonXuDeveloper merged commit 00ba108 into master Feb 1, 2026
20 checks passed
@JasonXuDeveloper JasonXuDeveloper deleted the test/ui-editor-internal-tests branch February 1, 2026 03:46
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