Skip to content

Error: Invalid argument passed to dotnet test in workflow #31

@Hemavathi15sg

Description

@Hemavathi15sg

The CI workflow fails because the test command uses an invalid argument for 'dotnet test'. The logs state:

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.

Proposed Solution:
Update the test running step in the workflow to:

dotnet test api/CourseRegistration.Tests/CourseRegistration.Tests.csproj --configuration Release

or simply:

dotnet test api/CourseRegistration.Tests --configuration Release

This change allows the dotnet test command to build and run tests as intended, rather than running directly on the DLL, which is not a supported usage for dotnet test.

Optional: Review CS8625 warnings in the controllers and avoid passing null to non-nullable references to improve code quality.

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