Skip to content

Add CI workflow and unit tests for HubDocs functionality#3

Merged
mberrishdev merged 2 commits into
mainfrom
unit-tests
Apr 19, 2026
Merged

Add CI workflow and unit tests for HubDocs functionality#3
mberrishdev merged 2 commits into
mainfrom
unit-tests

Conversation

@mberrishdev
Copy link
Copy Markdown
Owner

@mberrishdev mberrishdev commented Apr 19, 2026

Note

Low Risk
Low risk: adds CI automation and new unit tests without changing production library behavior; main risk is CI instability due to targeting .NET 10.0.x and new coverage tooling.

Overview
Adds a new GitHub Actions workflow (ci-build-test.yml) to restore/build HubDocs.sln, run unit tests with code coverage collection, generate an HTML/Markdown coverage report, and upload coverage artifacts on pushes/PRs to main/master.

Introduces unit tests covering HubDocs internals: endpoint registration via AddHubDocs, hub route discovery and hub metadata generation (including typed client methods), method signature/type/nullable formatting, base/derived method deduping, plus basic tests for HubDocsAttribute usage and HubRouteRegistry state updates.

Reviewed by Cursor Bugbot for commit 1525785. Bugbot is set up for automated code reviews on this repo. Configure here.

@mberrishdev mberrishdev merged commit b9646cf into main Apr 19, 2026
3 checks passed
@mberrishdev mberrishdev deleted the unit-tests branch April 19, 2026 18:08
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1525785. Configure here.

Assert.Contains("/hubdocs/index.html", routeEndpoints);
Assert.Contains("/hubdocs", routeEndpoints);

await app.StopAsync();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WebApplication not cleaned up on test assertion failure

Medium Severity

Both tests that call app.StartAsync() place app.StopAsync() after assertions without a try/finally block. If any assertion between StartAsync and StopAsync throws, the WebApplication is never stopped, leaving the port bound. Since both tests are in the same class (xUnit runs them sequentially), a failure in the first test will cascade into a port-conflict failure in the second test, making debugging harder.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1525785. Configure here.

{
public void AcceptsNullableRef(string? value)
{
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unused test fixture method AcceptsNullableRef

Low Severity

AcceptsNullableRef(string? value) in NullableHolder is never referenced by any test. The existing tests use AcceptsNullableValue and AcceptsNonNullableRef, but no test exercises the nullable reference type case. This is dead code that may also indicate a missing test for nullable reference type detection via IsNullable.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1525785. Configure here.

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