Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,641,820
Community Members
 
Community Events
196
Community Groups

Unable to test dotnet project

Edited

I'm trying to run dotnet test on a solution and unable to.

pipeline:

 

image: mcr.microsoft.com/dotnet/sdk:6.0

pipelines:

  default:

  - step:

      name: Build

      caches:

        - dotnetcore

      script:

        - dotnet restore

        - dotnet build --no-restore --configuration Release

        - dotnet test --no-build --no-restore -v d
       
If I remove the last line, `dotnet test`... than is it successful
The error shown is:
Test run for /opt/atlassian/pipelines/agent/build/thresholds-module.tests/bin/Debug/net6.0/thresholds-module.tests.dll (.NETCoreApp,Version=v6.0)

Microsoft (R) Test Execution Command Line Tool Version 17.3.0 (x64)

Copyright (c) Microsoft Corporation. All rights reserved.

The argument /opt/atlassian/pipelines/agent/build/thresholds-module.tests/bin/Debug/net6.0/thresholds-module.tests.dll is invalid. Please use the /help option to check the list of valid arguments.

1 answer

I found this answer on my search for the same error, so I'll answer it for the next ones coming here.

Look at the last 2 commands in your script:

- dotnet build --no-restore --configuration Release
- dotnet test --no-build --no-restore -v d

You are building in Release configuration but are testing in Debug configuration.

So the dotnet test command doesn't find any assemblies for running tests due to the --no-build switch.

In this case I think it would have been much more helpful for you (and me) if the error message had been a "file not found" instead of the less specific "argument is invalid". 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events