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

Make recording.proxyManualStartEnv private #21288

Merged
merged 1 commit into from
Jul 28, 2023
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
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"
benbp marked this conversation as resolved.
Show resolved Hide resolved

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