-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d403f8a
change naming convention to WORKLOAD_MANAGER_URL
katara-Jayprakash 943a580
convert WORKLOAD_MANAGER_ADDR to WORKLOAD_MANAGER_URL
katara-Jayprakash deadc9f
done with yaml conversion too
katara-Jayprakash af4461e
maintaining code readability
katara-Jayprakash 0738d7e
refactoring testHandleCodeInterpreterInvoke function
katara-Jayprakash 6908a45
refactoring testConcurrencyLimitMiddleware_Overload
katara-Jayprakash c7274f7
refactoring code with adding setupTestEnv func
katara-Jayprakash 69a4ce3
modified testServer_StartContext func
katara-Jayprakash d1f85ba
modified TestServer_RedisIntegration func
katara-Jayprakash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,17 +23,20 @@ import ( | |
| "time" | ||
| ) | ||
|
|
||
| func TestNewServer(t *testing.T) { | ||
| // Set required environment variables for tests | ||
| func setupTestEnv(t *testing.T) { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. trying to refactoring the code by adding/implementing the |
||
| t.Helper() | ||
| os.Setenv("REDIS_ADDR", "localhost:6379") | ||
| os.Setenv("REDIS_PASSWORD", "test-password") | ||
| os.Setenv("WORKLOAD_MANAGER_ADDR", "http://localhost:8080") | ||
| defer func() { | ||
| os.Setenv("WORKLOAD_MANAGER_URL", "http://localhost:8080") | ||
| t.Cleanup(func() { | ||
| os.Unsetenv("REDIS_ADDR") | ||
| os.Unsetenv("REDIS_PASSWORD") | ||
| os.Unsetenv("WORKLOAD_MANAGER_ADDR") | ||
| }() | ||
|
|
||
| os.Unsetenv("WORKLOAD_MANAGER_URL") | ||
| }) | ||
| } | ||
| func TestNewServer(t *testing.T) { | ||
| // Set required environment variables for tests | ||
| setupTestEnv(t) | ||
| tests := []struct { | ||
| name string | ||
| config *Config | ||
|
|
@@ -114,14 +117,7 @@ func TestNewServer(t *testing.T) { | |
|
|
||
| func TestServer_DefaultValues(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") | ||
| defer func() { | ||
| os.Unsetenv("REDIS_ADDR") | ||
| os.Unsetenv("REDIS_PASSWORD") | ||
| os.Unsetenv("WORKLOAD_MANAGER_ADDR") | ||
| }() | ||
| setupTestEnv(t) | ||
|
|
||
| config := &Config{ | ||
| Port: "8080", | ||
|
|
@@ -141,14 +137,7 @@ func TestServer_DefaultValues(t *testing.T) { | |
|
|
||
| func TestServer_ConcurrencyLimitMiddleware(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") | ||
| defer func() { | ||
| os.Unsetenv("REDIS_ADDR") | ||
| os.Unsetenv("REDIS_PASSWORD") | ||
| os.Unsetenv("WORKLOAD_MANAGER_ADDR") | ||
| }() | ||
| setupTestEnv(t) | ||
|
|
||
| config := &Config{ | ||
| Port: "8080", | ||
|
|
@@ -174,14 +163,7 @@ func TestServer_ConcurrencyLimitMiddleware(t *testing.T) { | |
|
|
||
| func TestServer_SetupRoutes(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") | ||
| defer func() { | ||
| os.Unsetenv("REDIS_ADDR") | ||
| os.Unsetenv("REDIS_PASSWORD") | ||
| os.Unsetenv("WORKLOAD_MANAGER_ADDR") | ||
| }() | ||
| setupTestEnv(t) | ||
|
|
||
| config := &Config{ | ||
| Port: "8080", | ||
|
|
@@ -203,14 +185,7 @@ func TestServer_SetupRoutes(t *testing.T) { | |
|
|
||
| func TestServer_StartContext(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") | ||
| defer func() { | ||
| os.Unsetenv("REDIS_ADDR") | ||
| os.Unsetenv("REDIS_PASSWORD") | ||
| os.Unsetenv("WORKLOAD_MANAGER_ADDR") | ||
| }() | ||
| setupTestEnv(t) | ||
|
|
||
| config := &Config{ | ||
| Port: "0", // Use port 0 to let the OS assign a free port | ||
|
|
@@ -251,14 +226,7 @@ func TestServer_StartContext(t *testing.T) { | |
|
|
||
| func TestServer_TLSConfiguration(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") | ||
| defer func() { | ||
| os.Unsetenv("REDIS_ADDR") | ||
| os.Unsetenv("REDIS_PASSWORD") | ||
| os.Unsetenv("WORKLOAD_MANAGER_ADDR") | ||
| }() | ||
| setupTestEnv(t) | ||
|
|
||
| tests := []struct { | ||
| name string | ||
|
|
@@ -330,14 +298,7 @@ func TestServer_TLSConfiguration(t *testing.T) { | |
|
|
||
| func TestServer_RedisIntegration(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") | ||
| defer func() { | ||
| os.Unsetenv("REDIS_ADDR") | ||
| os.Unsetenv("REDIS_PASSWORD") | ||
| os.Unsetenv("WORKLOAD_MANAGER_ADDR") | ||
| }() | ||
| setupTestEnv(t) | ||
|
|
||
| config := &Config{ | ||
| Port: "8080", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
directly calling setupEnv make more sense in all test