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

Don't hardcode runsettings if built from VS #20679

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Directory.Build.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)AzSdkTestLibKey.snk</AssemblyOriginatorKeyFile>
<!-- Disable doc comments for test projects -->
<DocumentationFile></DocumentationFile>
<RunSettingsFilePath>$(RepoEngPath)\nunit.runsettings</RunSettingsFilePath>
<RunSettingsFilePath Condition="'$(AZURE_SKIP_DEFAULT_RUN_SETTINGS)' != 'true'">$(RepoEngPath)\nunit.runsettings</RunSettingsFilePath>
</PropertyGroup>

<PropertyGroup Condition="'$(IsPerfProject)' == 'true' or '$(IsStressProject)' == 'true'">
Expand Down
9 changes: 9 additions & 0 deletions sdk/core/Azure.Core.TestFramework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ public class AppConfigurationTestEnvironment : TestEnvironment
}
```

## Test settings

Test settings can be configured via `.runsettings` files. See [nunit.runsettings](https://github.com/Azure/azure-sdk-for-net/blob/master/eng/nunit.runsettings) for available knobs.

There are two ways to work with `.runsettings`. Both are picked up by Visual Studio without restart.
- You can edit [nunit.runsettings](https://github.com/Azure/azure-sdk-for-net/blob/master/eng/nunit.runsettings) locally to achieve desired configuration.
- You can prepare few copies of `.runsettings` by cloning [nunit.runsettings](https://github.com/Azure/azure-sdk-for-net/blob/master/eng/nunit.runsettings).
Load them in Visual Studio (`Test>Configure Run Settings` menu) and switch between them. This option requires setting an environment variable `AZURE_SKIP_DEFAULT_RUN_SETTINGS=true`.

## TokenCredential

If a test or sample uses `TokenCredential` to construct the client use `TestEnvironment.Credential` to retrieve it.
Expand Down