Skip to content

test: improve coverage for MaterialComboDelegate and SceneTreeModel#232

Merged
fernandotonon merged 3 commits into
masterfrom
codex/coverage-over-80-v2
Mar 30, 2026
Merged

test: improve coverage for MaterialComboDelegate and SceneTreeModel#232
fernandotonon merged 3 commits into
masterfrom
codex/coverage-over-80-v2

Conversation

@fernandotonon
Copy link
Copy Markdown
Owner

@fernandotonon fernandotonon commented Mar 29, 2026

Summary

  • add branch-focused tests for MaterialComboDelegate
  • add broader behavioral tests for SceneTreeModel and SceneTreeItem
  • cover commit/close editor signal paths, model material write paths, tree parent/index behavior, and selection toggling branches

Notes

  • changes are test-only
  • intended to increase overall coverage for CI/Sonar

Validation

  • built UnitTests in local coverage build
  • ran targeted suites:
    • MaterialComboDelegateTest.*
    • SceneTreeModelTests.*
    • SceneTreeItemTests.*

Summary by CodeRabbit

  • Tests
    • Expanded unit test coverage for material combo delegate and selection set functionality to ensure robust behavior in edge cases and various operational conditions.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cdb37b86-9f67-4f0b-be1d-0c1ce7e56bf4

📥 Commits

Reviewing files that changed from the base of the PR and between 98ca2e9 and d1ced94.

📒 Files selected for processing (2)
  • src/MaterialComboDelegate_test.cpp
  • src/SelectionSet_test.cpp

📝 Walkthrough

Walkthrough

Two test files receive additional unit tests. MaterialComboDelegate_test.cpp gains tests for editor data handling without sub-entity context and signal behavior during close operations. SelectionSet_test.cpp gains tests for singleton lifecycle, empty selection handling, and position averaging across multiple nodes.

Changes

Cohort / File(s) Summary
MaterialComboDelegate Tests
src/MaterialComboDelegate_test.cpp
Added QMetaObject include and two tests: one verifying setEditorData behavior for material column without sub-entity context preserves selection state, another confirming commitAndCloseEditor invoked via QMetaObject does not emit signals when called without a sender.
SelectionSet Tests
src/SelectionSet_test.cpp
Added three tests: SingletonKillAndRecreateProducesValidInstance validates singleton recreation after kill, GetResolvedEntitiesWithEmptySelectionReturnsEmptyList asserts empty list for cleared selection, and GetSelectionCenterWithMultipleNodesAveragesPositions verifies position averaging across multiple scene nodes.

Possibly related PRs

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Five tests hopping in, so spry and bright,
Material combos and selections take flight!
No signals shall sneak without their say,
Positions average in just the right way!
The singleton lives, then dies, then springs back—
A rabbit's delight in the test-coverage track! 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description provides a clear summary of changes and validation steps, but lacks the structured sections specified in the template. Restructure the description to match the template format with explicit 'Summary', 'Technical Details', 'Features', and 'Bugfixes' sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective of adding test coverage for MaterialComboDelegate and SceneTreeModel, which aligns with the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/coverage-over-80-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@fernandotonon fernandotonon merged commit 75976a9 into master Mar 30, 2026
18 checks passed
@fernandotonon fernandotonon deleted the codex/coverage-over-80-v2 branch March 30, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant