-
Notifications
You must be signed in to change notification settings - Fork 42
✨feat:enhancement Replace all WORKLOAD_MANAGER_ADDR with WORKLOAD_MANAGER_URL #192
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
Changes from 3 commits
d403f8a
943a580
deadc9f
af4461e
0738d7e
6908a45
c7274f7
69a4ce3
d1f85ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -27,11 +27,11 @@ func TestNewServer(t *testing.T) { | |||||||||||||||||||||||||||||||||||||||||
| // Set required environment variables for tests | ||||||||||||||||||||||||||||||||||||||||||
| os.Setenv("REDIS_ADDR", "localhost:6379") | ||||||||||||||||||||||||||||||||||||||||||
| os.Setenv("REDIS_PASSWORD", "test-password") | ||||||||||||||||||||||||||||||||||||||||||
| os.Setenv("WORKLOAD_MANAGER_ADDR", "http://localhost:8080") | ||||||||||||||||||||||||||||||||||||||||||
| os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080") | ||||||||||||||||||||||||||||||||||||||||||
| defer func() { | ||||||||||||||||||||||||||||||||||||||||||
| os.Unsetenv("REDIS_ADDR") | ||||||||||||||||||||||||||||||||||||||||||
| os.Unsetenv("REDIS_PASSWORD") | ||||||||||||||||||||||||||||||||||||||||||
| os.Unsetenv("WORKLOAD_MANAGER_ADDR") | ||||||||||||||||||||||||||||||||||||||||||
| os.Unsetenv("WORKLOAD_MANAGER_URL") | ||||||||||||||||||||||||||||||||||||||||||
| }() | ||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||
| // Set required environment variables for tests | |
| os.Setenv("REDIS_ADDR", "localhost:6379") | |
| os.Setenv("REDIS_PASSWORD", "test-password") | |
| os.Setenv("WORKLOAD_MANAGER_ADDR", "http://localhost:8080") | |
| os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080") | |
| defer func() { | |
| os.Unsetenv("REDIS_ADDR") | |
| os.Unsetenv("REDIS_PASSWORD") | |
| os.Unsetenv("WORKLOAD_MANAGER_ADDR") | |
| os.Unsetenv("WORKLOAD_MANAGER_URL") | |
| }() | |
| // Set required environment variables for tests | |
| os.Setenv("REDIS_ADDR", "localhost:6379") | |
| os.Setenv("REDIS_PASSWORD", "test-password") | |
| os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080") | |
| t.Cleanup(func() { | |
| os.Unsetenv("REDIS_ADDR") | |
| os.Unsetenv("REDIS_PASSWORD") | |
| os.Unsetenv("WORKLOAD_MANAGER_URL") | |
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block for setting and unsetting environment variables is repeated in multiple tests. To improve maintainability and reduce code duplication, you can use the existing
setupEnvandteardownEnvhelper functions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katara-Jayprakash pelease help fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i fixed them and additionally refactor the another testCases