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

Use RunSettingsFilePath from project file when using dotnet test #2272

Merged

Conversation

nohwnd
Copy link
Member

@nohwnd nohwnd commented Dec 11, 2019

Description

Uses the RunSettingsFilePath from project file when specified and falls
back to the one specified in console, or the default setting if none are
provided.

The path to the settings file can be specified in multiple ways,
for example as a path relative to the project file. This enables
dotnet test to be invoked against the project file directly.

<RunSettingsFilePath>$(ProjectDir)..\example.runsettings</RunSettingsFilePath>

Alternatively path can also be specified relatively to solution file, but that will
only work when running dotnet test against the solution. On the other hand the
setting will be the same in all projects.

<RunSettingsFilePath>$(SolutionDir)\example.runsettings</RunSettingsFilePath>

The setting file can be overridden by specifying --settings from the command line
to give flexibility in providing alternative runsettings.

Related issue

Fixes #2265

@singhsarab
Copy link
Contributor

@ViktorHofer You might want to take a look at this one.

@nohwnd nohwnd changed the title Use RunSettingsFilePath from when using dotnet test Use RunSettingsFilePath from project file when using dotnet test Dec 12, 2019
@ViktorHofer
Copy link
Member

The path to the settings file can be specified in multiple ways

My understand was that we can point to any runsettings file anywhere on disk. Your description indicates that we can only point to a project level or solution level runsettings file. Is that correct?

@nohwnd
Copy link
Member Author

nohwnd commented Dec 12, 2019

You can point to a file anywhere on the disk.

The given examples use paths relative to a project or solution file, because I assumed that is what people will want to do most often. But you are not limited to do just that. You can use absolute path as well.

@ViktorHofer
Copy link
Member

Great, just wanted to make sure of that. Thanks.

Uses the RunSettingsFilePath from project file when specified and falls
back to the one specified in console, or the default setting if none are
provided.

The path to the settings file can be specified in multiple ways,
for example as a path relative to the project file. This enables
`dotnet test` to be invoked against the project file directly.

```xml
<RunSettingsFilePath>$(ProjectDir)..\example.runsettings</RunSettingsFilePath>
```

Alternatively path can also be specified relatively to solution file, but that will
only work when running dotnet test against the solution. On the other hand the
setting will be the same in all projects.

```xml
<RunSettingsFilePath>$(SolutionDir)\example.runsettings</RunSettingsFilePath>
```

Fixes microsoft#2265
@nohwnd nohwnd force-pushed the use-runsettingsfilepath-from-project branch from 0f7e2d3 to 9b6a5f7 Compare December 12, 2019 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RunSettingsFilePath property isn't honored by VSTest
4 participants