Skip to content

Commit

Permalink
Update default SPaaS port to 5100.
Browse files Browse the repository at this point in the history
  • Loading branch information
brainbot-devops committed Aug 27, 2019
1 parent 40c3f15 commit 135d8c8
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions examples/scenario-example-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ token:
## name - Token name, default: autogenerated
## symbol - Token symbol, default: autogenerated
## decimals - Token decimals, default: 0
## balance_min - Minimum node balance, default: 5000
## balance_min - Minimum node balance, default: 5100
## reuse - remember the token and reuse it for the next run of this scenario, default: false
#name: "Some token"
#symbol: "STKN"
#decimals: 18
#balance_min: 5000
#balance_min: 5100
#reuse: true

nodes:
Expand Down
6 changes: 3 additions & 3 deletions scenario_player/services/utils/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ def default_service_daemon_cli():
Configures the following options:
* <command> (required) - must be one of `start` or `stop`.
* --port (optional) - the port to assign to the service. Defaults to 5000.
* --port (optional) - the port to assign to the service. Defaults to 5100.
* --host (optional) - the host to assign to the service. Defaults to 127.0.0.1
"""
parser = argparse.ArgumentParser()
parser.add_argument("command", choices=["start", "stop"])
parser.add_argument(
"--port",
default=5000,
help="Port number to run this service on. Defaults to '5000'",
default=5100,
help="Port number to run this service on. Defaults to '5100'",
type=int,
)
parser.add_argument(
Expand Down
6 changes: 3 additions & 3 deletions scenario_player/utils/configuration/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class UDCTokenSettings(ConfigMapping):
...
token:
deposit: false
balance_per_node: 5000
max_funding: 5000
balance_per_node: 5100
max_funding: 5100
...
"""

Expand Down Expand Up @@ -86,7 +86,7 @@ def deposit(self) -> bool:
@property
def balance_per_node(self) -> int:
"""The required amount of UDC/RDN tokens required by each node."""
return int(self.get("balance_per_node", 5000))
return int(self.get("balance_per_node", 5100))

@property
def max_funding(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion scenario_player/utils/configuration/spaas.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def host(self):

@property
def port(self):
return self.get("port", "5000")
return self.get("port", "5100")

@property
def netloc(self):
Expand Down
4 changes: 2 additions & 2 deletions scenario_player/utils/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SPaaSAdapter(HTTPAdapter):
Handles requests made using the `spaas` scheme and maps the url to a configured
service, if available. If no configuration for the service exists, we always
assume it's available at localhost:5000 (the default flask port).
assume it's available at localhost:5100 (the default flask port).
"""

def __init__(self, spaas_settings: SPaaSConfig):
Expand All @@ -63,7 +63,7 @@ def prep_service_request(self, request) -> requests.PreparedRequest:
path = f"{request.service}{parsed[2]}"
unparse_args = (
service_conf.scheme or "http",
service_conf.netloc or "localhost:5000",
service_conf.netloc or "localhost:5100",
path,
*parsed[3:],
)
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/utils/configuration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ def expected_defaults():
"node_options": {},
"raiden_version": "LATEST",
},
"spaas": {"rpc": {"scheme": "https", "host": "localhost", "port": 5000}},
"spaas": {"rpc": {"scheme": "https", "host": "localhost", "port": 5100}},
}
2 changes: 1 addition & 1 deletion tests/unittests/utils/configuration/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_attributes_return_for_key_value_if_key_present(

@pytest.mark.parametrize(
"key, expected",
argvalues=[("deposit", False), ("balance_per_node", 5000), ("max_funding", 5000)],
argvalues=[("deposit", False), ("balance_per_node", 5100), ("max_funding", 5100)],
)
def test_attributes_whose_key_is_absent_return_expected_default(
self, key, expected, minimal_yaml_dict
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/utils/configuration/test_spaas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@pytest.mark.parametrize(
"prop, expected_value",
argvalues=[("scheme", "http"), ("port", "5000"), ("netloc", "127.0.0.1:5000")],
argvalues=[("scheme", "http"), ("port", "5100"), ("netloc", "127.0.0.1:5100")],
)
def test_service_config_properties_return_expected_defaults_if_keys_missing(prop, expected_value):
service_config = SPaaSServiceConfig({})
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/utils/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_send_loads_host_and_port_correctly(self, _, scheme, host, port, service
SPaaSAdapter.prep_service_request should default to sensible values."""

expected_url = (
f"{scheme or 'http'}://{host or '127.0.0.1'}:{port or '5000'}/{service}/my-endpoint"
f"{scheme or 'http'}://{host or '127.0.0.1'}:{port or '5100'}/{service}/my-endpoint"
)

input_config = {}
Expand Down Expand Up @@ -112,5 +112,5 @@ def test_exceptions_are_converted_correctly_when_expected(
with pytest.raises(expected_err):
config = SPaaSConfig({"spaas": {}})
adapter = SPaaSAdapter(config)
req = requests.Request(url="http://127.0.0.1:5000").prepare()
req = requests.Request(url="http://127.0.0.1:5100").prepare()
adapter.send(req)

0 comments on commit 135d8c8

Please sign in to comment.