Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
run: dotnet restore

- name: test
run: dotnet test --project ./tests/NuGetUtility.Test.UrlToLicenseMapping/NuGetUtility.Test.UrlToLicenseMapping.csproj --configuration Release --no-restore
run: dotnet test --project ./tests/NuGetUtility.UrlToLicenseMapping.Test/NuGetUtility.UrlToLicenseMapping.Test.csproj --configuration Release --no-restore

test_windows:
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: test
uses: josepho0918/vstest-action@main
with:
testAssembly: "*.Test.*dll"
testAssembly: "NuGet*.Test.dll"

@coderabbitai coderabbitai Bot Nov 7, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that test coverage is complete with the new pattern.

The pattern has been narrowed from *.Test.*dll to NuGet*.Test.dll. This will match assemblies like NuGetUtility.Test.dll, NuGetLicense.Test.dll, and NuGetUtility.UrlToLicenseMapping.Test.dll, but will exclude SPDXLicenseMatcher.Test.dll if it exists.

Run the following script to verify which test assemblies exist and confirm the pattern matches all intended test projects:


🏁 Script executed:

#!/bin/bash
# Find all test DLLs that would be in the Release build output
echo "=== Test assemblies that exist in solution ==="
fd -e csproj -t f 'Test.csproj$' tests/

echo ""
echo "=== Assemblies matching new pattern NuGet*.Test.dll ==="
rg -g 'NuGetUtility.sln' --no-filename 'Project.*Test.*csproj' | gawk 'match($0, /"([^"]+\.Test)[^"]*\.csproj"/, arr) {print arr[1] ".dll"}' | grep '^NuGet.*\.Test\.dll$'

echo ""
echo "=== Assemblies potentially excluded by new pattern ==="
rg -g 'NuGetUtility.sln' --no-filename 'Project.*Test.*csproj' | gawk 'match($0, /"([^"]+\.Test)[^"]*\.csproj"/, arr) {print arr[1] ".dll"}' | grep -v '^NuGet.*\.Test\.dll$'

Length of output: 700


I need to verify whether SPDXLicenseMatcher.Test is an intentional part of the test coverage or if this exclusion is deliberate.

Based on the script results, the review comment has identified a critical issue with the test pattern change. The script output confirms that:

  1. Four test projects exist in the solution:

    • NuGetLicense.Test
    • NuGetUtility.Test
    • NuGetUtility.UrlToLicenseMapping.Test
    • SPDXLicenseMatcher.Test
  2. The new pattern NuGet*.Test.dll will exclude SPDXLicenseMatcher.Test because it doesn't start with the "NuGet" prefix.

  3. The old pattern *.Test.*dll would have included all four test assemblies, providing complete coverage.

This is a definite regression in test coverage that will cause SPDXLicenseMatcher.Test.dll to be excluded from the release workflow testing.

Update test assembly pattern to include all test projects.

The change from *.Test.*dll to NuGet*.Test.dll excludes SPDXLicenseMatcher.Test.dll, reducing test coverage. Update the pattern to *Test*.dll or explicitly list all test projects to ensure comprehensive test execution in the release workflow.

🤖 Prompt for AI Agents
.github/workflows/release.yml around line 38: the testAssembly pattern was
narrowed to "NuGet*.Test.dll" which excludes SPDXLicenseMatcher.Test.dll and
reduces test coverage; change the value to a pattern that includes all test
assemblies (for example "*Test*.dll") or replace with an explicit
comma-separated list of all four test DLLs (NuGetLicense.Test.dll,
NuGetUtility.Test.dll, NuGetUtility.UrlToLicenseMapping.Test.dll,
SPDXLicenseMatcher.Test.dll) so the release workflow runs every test project.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The exclusion is deliberate

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@sensslen, understood! I've noted that the exclusion of SPDXLicenseMatcher.Test.dll from the release workflow is intentional. Thank you for the clarification.


✏️ Learnings added
Learnt from: sensslen
Repo: sensslen/nuget-license PR: 327
File: .github/workflows/release.yml:38-38
Timestamp: 2025-11-07T21:33:27.152Z
Learning: In the release workflow (.github/workflows/release.yml), the test assembly pattern `NuGet*.Test.dll` intentionally excludes SPDXLicenseMatcher.Test.dll from the release workflow tests.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

searchFolder: "tests/*/bin/Release/net9.0/"
runInParallel: true

Expand Down
2 changes: 1 addition & 1 deletion NuGetUtility.sln
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VersionRangesProject", "tes
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiTargetProjectWithDifferentDependencies", "tests\targets\MultiTargetProjectWithDifferentDependencies\MultiTargetProjectWithDifferentDependencies.csproj", "{A19BF89A-8B1F-4612-A923-08F52B53DC84}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetUtility.Test.UrlToLicenseMapping", "tests\NuGetUtility.Test.UrlToLicenseMapping\NuGetUtility.Test.UrlToLicenseMapping.csproj", "{A77F9673-8296-4680-A713-8AC26B7DE41C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetUtility.UrlToLicenseMapping.Test", "tests\NuGetUtility.UrlToLicenseMapping.Test\NuGetUtility.UrlToLicenseMapping.Test.csproj", "{A77F9673-8296-4680-A713-8AC26B7DE41C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGetLicense", "src\NuGetLicense\NuGetLicense.csproj", "{AC47BC03-4D94-4E35-880A-83B7F00CCD39}"
EndProject
Expand Down
Loading