Skip to content

fix(tests): migrate bUnit tests to new Render API#77

Closed
phmatray wants to merge 3 commits intomainfrom
fix/actions-bunit-api-20260220
Closed

fix(tests): migrate bUnit tests to new Render API#77
phmatray wants to merge 3 commits intomainfrom
fix/actions-bunit-api-20260220

Conversation

@phmatray
Copy link
Owner

Issue

GitHub Actions workflow failing with bUnit API deprecation errors:

error CS0619: 'BunitContext.RenderComponent<TComponent>(params ComponentParameter[])' is obsolete

What Changed

  • Updated base class from TestContext to BunitContext
  • Replaced deprecated RenderComponent with Render
  • Added explicit using Bunit; directive

Why

bUnit updated their API and deprecated RenderComponent in favor of Render.

How to Test

  • CI workflow should pass
  • All tests remain functionally identical

Fixes CI failures from 2026-02-18.

- Update base class from TestContext to BunitContext
- Replace deprecated RenderComponent with Render
- Fixes GitHub Actions build failure due to bUnit API changes
@phmatray phmatray added the automated-fix Automated fix by Garry label Feb 20, 2026
@phmatray
Copy link
Owner Author

Root Cause Analysis

The bUnit v2 upgrade (PR #59, merged Feb 19) introduced breaking API changes that are causing test failures.

Compilation Errors

Multiple errors in FormCraftComponentTests.cs:

  1. CS1929: RenderTreeBuilder.Add() no longer exists

    • Error: 'RenderTreeBuilder' does not contain a definition for 'Add'
    • Lines: 32, 61, 91, 120, 146, 167, 194, 214
  2. CS1061: Type.Configuration property doesn't exist

    • Error: 'Type' does not contain a definition for 'Configuration'
    • Lines: 34, 63, 93, 122, 148, 169, 196, 216
  3. CS0023: Void operator issue on line 170

Needed Fixes

The bUnit v2 migration requires updating the test patterns:

  1. Render API - Already attempted in this PR, but needs refinement
  2. Component Parameter Passing - The .Add() calls need to use the new ComponentParameter builder pattern
  3. Configuration API - Review bUnit v2 docs for the new configuration approach

Recommendation

Rather than incrementally fixing, I recommend:

  1. Review the bUnit v2 migration guide
  2. Update all test cases to use the new API patterns
  3. Test locally before pushing (CI is currently failing on main)

Blocking PR merge until tests pass. This is a P1 issue since tests are broken on main branch.

@phmatray
Copy link
Owner Author

Closing automated fix PR — compilation errors indicate incomplete bUnit API migration. Wrong usage of RenderTreeBuilder.Add() and Type.Configuration. Needs manual review and proper fix.

@phmatray phmatray closed this Feb 21, 2026
@phmatray phmatray deleted the fix/actions-bunit-api-20260220 branch February 26, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-fix Automated fix by Garry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant