Skip to content

Improve the child unit of work and enum adapter tests - #26129

Open
maliming wants to merge 3 commits into
rel-10.7from
maliming/enum-adapter-uow-event-tests
Open

Improve the child unit of work and enum adapter tests#26129
maliming wants to merge 3 commits into
rel-10.7from
maliming/enum-adapter-uow-event-tests

Conversation

@maliming

@maliming maliming commented Sep 2, 2026

Copy link
Copy Markdown
Member

The ChildUnitOfWork event remove accessor had no test coverage. The enum adapter test also asserted that the default ASP.NET Core provider returns no adapter, which would fail if that provider ever gains one, without ABP being broken.

Copilot AI lite review requested due to automatic review settings September 2, 2026 10:04
@maliming
maliming requested a review from enisn September 2, 2026 10:05
@maliming maliming added this to the 10.7-final milestone Sep 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new child UoW test should explicitly assert it is operating on a child UoW, and the updated comment should avoid restating upstream ASP.NET Core behavior that the PR aims to decouple from.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR strengthens automated test coverage around ABP’s Unit of Work child-event behavior and makes the MVC enum adapter test less brittle against potential upstream ASP.NET Core changes.

Changes:

  • Added a unit test covering the Disposed event remove accessor behavior for child UoWs.
  • Simplified the enum adapter test by removing an assertion about the default ASP.NET Core provider returning null.
File summaries
File Description
framework/test/Volo.Abp.Uow.Tests/Volo/Abp/Uow/UnitOfWork_Child_Events_Tests.cs Adds a new test ensuring unsubscribing from Disposed on a child UoW doesn’t leak handlers or trigger callbacks.
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/DataAnnotations/AbpValidationAttributeAdapterProvider_Tests.cs Removes a brittle assertion about upstream behavior and keeps the focus on ABP providing an adapter.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@maliming

maliming commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review thread.

Co-authored-by: maliming <6908465+maliming@users.noreply.github.com>

Copilot AI commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply t...

Addressed both review comments in b875866:

  • Reworded the enum adapter test comment to describe ABP's intent rather than asserting ASP.NET Core's behavior.
  • Added childUow.Id.ShouldBe(parentUow.Id) in the disposed-event-unsubscribe test to explicitly assert it's operating on a child UoW.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.70%. Comparing base (d79292b) to head (b875866).
⚠️ Report is 5 commits behind head on rel-10.7.

Additional details and impacted files
@@             Coverage Diff              @@
##           rel-10.7   #26129      +/-   ##
============================================
- Coverage     49.74%   49.70%   -0.04%     
============================================
  Files          3821     3822       +1     
  Lines        133618   133511     -107     
  Branches      10114    10103      -11     
============================================
- Hits          66472    66368     -104     
+ Misses        65130    65125       -5     
- Partials       2016     2018       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants