-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary:
The build pipeline is failing at the test stage with the following error:
The argument /home/runner/work/CourseApplication/CourseApplication/api/CourseRegistration.Tests/bin/Release/net8.0/CourseRegistration.Tests.dll is invalid. Please use the /help option to check the list of valid arguments.
Details:
- The failing command is:
dotnet test ${{ env.TEST_PROJECT }} --configuration Release --no-build --logger trx - There are warnings about converting null literals to non-nullable reference types, but they are not fatal.
- The core problem is that the test runner is being passed a DLL path directly. This occurs if you use
dotnet vstestinstead ofdotnet test, but the workflow usesdotnet test. - This error can also appear if no test framework/adapters are present or if the project is misconfigured.
Suggested Solution:
- Verify that
api/CourseRegistration.Tests/CourseRegistration.Tests.csprojincludesMicrosoft.NET.Test.Sdk, a test framework such asxunitornunit, and a compatible test runner in its dependencies. - Make sure the test project targets
net8.0to match your workflow's .NET version. - Ensure there are actual tests in the project and that they use the correct attributes (e.g.,
[Fact]for xUnit). - Run
dotnet testlocally to confirm the issue and get further diagnostic output. - Adjust the workflow or test project as needed so
dotnet testcan discover and execute tests without errors.
References:
- Related warnings: CS8625 (nullable reference type)
- Workflow file: .github/workflows/ci-cd.yml
- Failing step and logs reference: Build, Test, and Deploy Course Registration API @ ed9c8f5
Labels:
- bug
- test
- ci
Copilot
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working