Skip to content

Fix failing test job: 'The argument ...CourseRegistration.Tests.dll is invalid' #16

@Hemavathi15sg

Description

@Hemavathi15sg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions