Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run single test using docker image #95436

Closed
verdie-g opened this issue Nov 30, 2023 · 8 comments
Closed

Run single test using docker image #95436

verdie-g opened this issue Nov 30, 2023 · 8 comments

Comments

@verdie-g
Copy link
Contributor

In docs/workflow/testing/libraries/testing.md it states that dotnet build should be used to run a single library/test but it doesn't seem to be available in the docker image. Is this scenario supported by the docker image?

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 30, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 30, 2023
@vcsjones
Copy link
Member

If you mean run a single library in a Codespace, use dotnet.sh instead of dotnet.

Like dotnet.sh build /t:Test /p:XUnitOptions="-class Test.ClassUnderTests"

@verdie-g
Copy link
Contributor Author

Oh thanks. Would it make sense to replace dotnet with dotnet.sh in the doc or most devs use the former?

@danmoseley danmoseley added area-Infrastructure-libraries and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 30, 2023
@ghost
Copy link

ghost commented Nov 30, 2023

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

In docs/workflow/testing/libraries/testing.md it states that dotnet build should be used to run a single library/test but it doesn't seem to be available in the docker image. Is this scenario supported by the docker image?

Author: verdie-g
Assignees: -
Labels:

area-Infrastructure-libraries, untriaged

Milestone: -

@ViktorHofer
Copy link
Member

dotnet works well if it's installed globally on the machine. Right now that should be case for most devs as we depend on the stable 8.0.100 SDK. We encourage devs to install the required SDK on their machines for optimal tooling support, i.e. VS and VSCode.

dotnet.sh either uses the globally installed SDK (if the version matches) or downloads the SDK and puts it into the repository under the .dotnet folder (repo local SDK).

@verdie-g
Copy link
Contributor Author

verdie-g commented Dec 3, 2023

What do you think of such change in the doc #95557 ?

@huoyaoyuan
Copy link
Member

.\dotnet.cmd and ./dotnet.sh are both used for local dotnet SDK resolving. I don't think it's specified to docker.

Will global dotnet run successfully when the repo is using a nightly SDK?

@carlossanlop carlossanlop removed the untriaged New issue has not been triaged by the area owner label Dec 6, 2023
@carlossanlop carlossanlop added this to the 9.0.0 milestone Dec 6, 2023
@verdie-g
Copy link
Contributor Author

So what are the recommendations dotnet.sh VS global dotnet?

cc @ViktorHofer

@ViktorHofer
Copy link
Member

ViktorHofer commented Jan 18, 2024

If the machine doesn't have the required (specified in the repo's global.json) SDK installed, use dotnet.cmd/sh, otherwise just use the dotnet on the path.

tmds pushed a commit to tmds/runtime that referenced this issue Jan 23, 2024
…5557)

* Add note about docker in the testing doc (fix dotnet#95436)

* Update testing.md
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants