Skip to content

Commit

Permalink
Make recording.proxyManualStartEnv private (Azure#21288)
Browse files Browse the repository at this point in the history
  • Loading branch information
benbp authored and chlowell committed Jul 31, 2023
1 parent 2eea6ec commit 1f2be46
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion sdk/internal/perf/recording_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/internal/recording"
)

const proxyManualStartEnv = "PROXY_MANUAL_START"

func TestRecordingHTTPClient_Do(t *testing.T) {
// Ignore manual start in pipeline tests, we always want to exercise install
os.Setenv(recording.ProxyManualStartEnv, "false")
os.Setenv(proxyManualStartEnv, "false")

proxy, err := recording.StartTestProxy("", nil)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion sdk/internal/recording/matchers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestMatchers(t *testing.T) {

func (s *matchersTests) SetupSuite() {
// Ignore manual start in pipeline tests, we always want to exercise install
os.Setenv(ProxyManualStartEnv, "false")
os.Setenv(proxyManualStartEnv, "false")
proxy, err := StartTestProxy("", nil)
s.proxy = proxy
require.NoError(s.T(), err)
Expand Down
2 changes: 1 addition & 1 deletion sdk/internal/recording/recording_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestRecording(t *testing.T) {

func (s *recordingTests) SetupSuite() {
// Ignore manual start in pipeline tests, we always want to exercise install
os.Setenv(ProxyManualStartEnv, "false")
os.Setenv(proxyManualStartEnv, "false")
proxy, err := StartTestProxy("", nil)
s.proxy = proxy
require.NoError(s.T(), err)
Expand Down
6 changes: 3 additions & 3 deletions sdk/internal/recording/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"time"
)

const ProxyManualStartEnv = "PROXY_MANUAL_START"
const proxyManualStartEnv = "PROXY_MANUAL_START"

type TestProxyInstance struct {
Cmd *exec.Cmd
Expand Down Expand Up @@ -366,9 +366,9 @@ func waitForProxyStart(cmd *exec.Cmd, options *RecordingOptions) (*TestProxyInst
}

func StartTestProxy(pathToRecordings string, options *RecordingOptions) (*TestProxyInstance, error) {
manualStart := strings.ToLower(os.Getenv(ProxyManualStartEnv))
manualStart := strings.ToLower(os.Getenv(proxyManualStartEnv))
if manualStart == "true" {
log.Printf("%s env variable is set to true, not starting test proxy...\n", ProxyManualStartEnv)
log.Printf("%s env variable is set to true, not starting test proxy...\n", proxyManualStartEnv)
return nil, nil
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/internal/recording/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestServer(t *testing.T) {

func (s *serverTests) SetupSuite() {
// Ignore manual start in pipeline tests, we always want to exercise install
os.Setenv(ProxyManualStartEnv, "false")
os.Setenv(proxyManualStartEnv, "false")
}

func (s *serverTests) TestProxyDownloadFile() {
Expand Down

0 comments on commit 1f2be46

Please sign in to comment.