The action job for build and test is failing due to an invalid test argument error:
The argument ...CourseRegistration.Tests.dll is invalid. Please use the /help option to check the list of valid arguments.
Cause:
- The test script tried to run the
dotnet test command on a DLL instead of the .csproj file. The dotnet test command requires the path to a test project file (e.g., .csproj), not a compiled DLL.
Solution:
- In
.github/workflows/ci-cd.yml, make sure the Test step uses the project file path:
- name: Test
run: dotnet test api/CourseRegistration.Tests/CourseRegistration.Tests.csproj --configuration Release --no-build --logger trx
- Ensure the environment variable
TEST_PROJECT (if used) points to the .csproj and not a DLL.
Reference job log and workflow file:
After applying the fix, re-run the pipeline to verify the tests execute correctly.