Skip to content

Commit dd04d39

Browse files
scbeddchristothes
andauthored
Naive implementation of allowing env override (Azure#37780)
* naive implementation of allowing env override Co-authored-by: Christopher Scott <[email protected]>
1 parent 167471e commit dd04d39

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sdk/core/Azure.Core.TestFramework/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@ public KeyClientLiveTests(bool isAsync, KeyClientOptions.ServiceVersion serviceV
366366
}
367367
```
368368

369+
__Note:__ A user can set the environment variable PROXY_DEBUG_MODE to a truthy value prior to invoking, just like if they set `UseLocalDebugProxy` in their code.
370+
369371
In order to debug the test proxy, you will need to clone the [azure-sdk-tools](https://github.com/Azure/azure-sdk-tools) repo. The best practice is to first create a fork of the repo, and then clone your fork locally.
370372

371373
Once you have cloned the repo, open the [Test Proxy solution](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy.sln) in your IDE.

sdk/core/Azure.Core.TestFramework/src/TestProxy.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ static TestProxy()
6060

6161
private TestProxy(string proxyPath, bool debugMode = false)
6262
{
63+
bool.TryParse(Environment.GetEnvironmentVariable("PROXY_DEBUG_MODE"), out bool environmentDebugMode);
64+
65+
debugMode |= environmentDebugMode;
66+
6367
ProcessStartInfo testProxyProcessInfo = new ProcessStartInfo(
6468
s_dotNetExe,
6569
$"\"{proxyPath}\" --storage-location=\"{TestEnvironment.RepositoryRoot}\"")

0 commit comments

Comments
 (0)