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
Add GatewayPort configuration #67
Changes from 6 commits
6ea3fb3
86009b9
f129046
02a9466
5cd92a1
0b02d9f
0b8dcbd
1d79dac
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 |
---|---|---|
|
@@ -62,6 +62,7 @@ func Test_ReadConfig(t *testing.T) { | |
|
||
os.Setenv("faas_nats_address", "test_nats") | ||
os.Setenv("faas_gateway_address", "test_gatewayaddr") | ||
os.Setenv("faas_gateway_port", "8080") | ||
os.Setenv("faas_function_suffix", "test_suffix") | ||
os.Setenv("faas_print_body", "true") | ||
os.Setenv("write_debug", "true") | ||
|
@@ -76,12 +77,18 @@ func Test_ReadConfig(t *testing.T) { | |
t.Fail() | ||
} | ||
|
||
expected = "test_gatewayaddr" | ||
expected = "test_gatewayaddr:8080" | ||
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. Can you use the word 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. I think we should then refactor the whole test file, since all tests are using 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. Yes, but this is not refactoring, it's naming. Please go ahead. |
||
if config.GatewayAddress != expected { | ||
t.Logf("Expected GatewayAddress `%s` actual `%s`\n", expected, config.GatewayAddress) | ||
t.Fail() | ||
} | ||
|
||
expectedGatewayPort := 8080 | ||
if config.GatewayPort != expectedGatewayPort { | ||
t.Logf("Expected GatewayPort `%d` actual `%d`\n", expectedGatewayPort, config.GatewayPort) | ||
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. I.e. |
||
t.Fail() | ||
} | ||
|
||
expected = "test_suffix" | ||
if config.FunctionSuffix != expected { | ||
t.Logf("Expected FunctionSuffix `%s` actual `%s`\n", expected, config.FunctionSuffix) | ||
|
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.
We could probably concatenate the value once here instead of passing two arguments everywhere.
I think the new env var makes sense to prevent issues upgrading versions.
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.