Download image instead of building #459
5 fail, 6 skipped, 43 pass in 7s
Annotations
Check warning on line 0 in tests.unit.test_prompt_feeder_local.PromptFeederUnitTests
github-actions / Test Results
test_docker_config_all_local (tests.unit.test_prompt_feeder_local.PromptFeederUnitTests) failed
node-runner-cli/junit/test-results.xml [took 0s]
Raw output
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
self = <tests.unit.test_prompt_feeder_local.PromptFeederUnitTests testMethod=test_docker_config_all_local>
mockout = <_io.StringIO object at 0x7f9fbafce8c0>
@patch("sys.stdout", new_callable=StringIO)
def test_docker_config_all_local(self, mockout):
urllib3.disable_warnings()
with open("/tmp/genesis.json", "w") as fp:
pass
PROMPT_NETWORKID = "2"
PROMPT_FULLNODE_YES_NO = "Y"
PROMPT_SEEDNODES = "radix://node_tdx_22_1qvsml9pe32rzcrmw6jx204gjeng09adzkqqfz0ewhxwmjsaas99jzrje4u3@34.243.93.185"
PROMPT_VALIDATOR_ADDRESS = "N"
PROMPT_EXISTING_KEYSTORE = "Y"
PROMPT_KEYSTORE_LOCATION = "/tmp/babylon-node-config"
PROMPT_KEYSTORE_FILE_NAME = "node-keystore.ks"
PROMPT_LEDGER_LOCATION = "/tmp/data"
PROMPT_NGINX_PROTECT_CORE_API = "true"
PROMPT_ENABLE_GATEWAY = "Y"
PROMPT_GATEWAY_CORE_API_URL = "http://core:3333/core"
PROMPT_GATEWAY_CORE_API_NAME = "core"
PROMPT_POSTGRES_LOCAL_REMOTE = "local"
PROMPT_POSTGRES_USERNAME = "postgres"
PROMPT_POSTGRES_DATABASE_NAME = "radix-ledger"
PROMPT_POSTGRES_PASSWORD = "pgpassword"
PROMPT_GATEWAY_IMAGE_VERSION = ""
PROMPT_MIGRATION_IMAGE_VERSION = ""
PROMPT_AGGREGATOR_IMAGE_VERSION = ""
PROMPT_NGINX_PROTECT_GATEWAY = "true"
PROMPT_NGINX_IMAGE_VERSION = ""
PROMPT_CONFIRM_CONFIG = "Y"
with patch(
"builtins.input",
side_effect=[
PROMPT_NETWORKID,
PROMPT_FULLNODE_YES_NO,
PROMPT_SEEDNODES,
PROMPT_VALIDATOR_ADDRESS,
PROMPT_EXISTING_KEYSTORE,
PROMPT_KEYSTORE_LOCATION,
PROMPT_KEYSTORE_FILE_NAME,
PROMPT_LEDGER_LOCATION,
PROMPT_NGINX_PROTECT_CORE_API,
PROMPT_ENABLE_GATEWAY,
PROMPT_GATEWAY_CORE_API_URL,
PROMPT_GATEWAY_CORE_API_NAME,
PROMPT_POSTGRES_LOCAL_REMOTE,
PROMPT_POSTGRES_USERNAME,
PROMPT_POSTGRES_DATABASE_NAME,
PROMPT_POSTGRES_PASSWORD,
PROMPT_GATEWAY_IMAGE_VERSION,
PROMPT_MIGRATION_IMAGE_VERSION,
PROMPT_AGGREGATOR_IMAGE_VERSION,
PROMPT_NGINX_PROTECT_GATEWAY,
PROMPT_NGINX_IMAGE_VERSION,
],
):
with patch(
"sys.argv",
[
"main",
"docker",
"config",
"-m",
"DETAILED",
"-k",
"radix",
"-nk",
"-a",
"-d",
"/tmp",
],
):
> main()
tests/unit/test_prompt_feeder_local.py:156:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
babylonnode.py:93: in main
dockercli_args.func(dockercli_args)
commands/dockercommand.py:197: in config
docker_config = DockerSetup.questionary(argument_object)
setup/DockerSetup.py:363: in questionary
if docker_config.common_config.check_nginx_required():
config/CommonDockerConfig.py:73: in check_nginx_required
if json.loads(self.nginx_settings.protect_core.lower()):
/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/json/__init__.py:346: in loads
return _default_decoder.decode(s)
/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <json.decoder.JSONDecoder object at 0x7f9fbe49c9a0>, s = 'y', idx = 0
def raw_decode(self, s, idx=0):
"""Decode a JSON document from ``s`` (a ``str`` beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in ``s`` where the document ended.
This can be used to decode a JSON document from a string that may
have extraneous data at the end.
"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Check warning on line 0 in tests.unit.test_prompt_feeder_local.PromptFeederUnitTests
github-actions / Test Results
test_docker_config_gateway_external_postgres (tests.unit.test_prompt_feeder_local.PromptFeederUnitTests) failed
node-runner-cli/junit/test-results.xml [took 0s]
Raw output
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
self = <tests.unit.test_prompt_feeder_local.PromptFeederUnitTests testMethod=test_docker_config_gateway_external_postgres>
mockout = <_io.StringIO object at 0x7f9fbafcf880>
@patch("sys.stdout", new_callable=StringIO)
def test_docker_config_gateway_external_postgres(self, mockout):
urllib3.disable_warnings()
PROMPT_NETWORKID = "14"
PROMPT_FULLNODE_YES_NO = "Y"
# PROMPT_SEEDNODES = ''
PROMPT_VALIDATOR_ADDRESS = "n"
PROMPT_EXISTING_KEYSTORE = "Y"
PROMPT_KEYSTORE_LOCATION = ""
PROMPT_KEYSTORE_FILE_NAME = ""
PROMPT_LEDGER_LOCATION = ""
PROMPT_NGINX_PROTECT_CORE_API = ""
PROMPT_ENABLE_GATEWAY = "Y"
PROMPT_GATEWAY_CORE_API_URL = "http://core:3333/core"
PROMPT_GATEWAY_CORE_API_NAME = ""
PROMPT_POSTGRES_LOCAL_REMOTE = "remote"
PROMPT_POSTGRES_REMOTE_URL = "postgres"
PROMPT_POSTGRES_REMOTE_PORT = "5432"
PROMPT_POSTGRES_DATABASE_NAME = ""
PROMPT_POSTGRES_USERNAME = ""
PROMPT_POSTGRES_PASSWORD = "radix"
PROMPT_GATEWAY_IMAGE_VERSION = ""
PROMPT_MIGRATION_IMAGE_VERSION = ""
PROMPT_AGGREGATOR_IMAGE_VERSION = ""
PROMPT_NGINX_PROTECT_GATEWAY = "true"
PROMPT_NGINX_IMAGE_VERSION = ""
PROMPT_CONFIRM_CONFIG = "Y"
with patch(
"builtins.input",
side_effect=[
PROMPT_NETWORKID,
PROMPT_FULLNODE_YES_NO,
# PROMPT_SEEDNODES,
PROMPT_VALIDATOR_ADDRESS,
PROMPT_EXISTING_KEYSTORE,
PROMPT_KEYSTORE_LOCATION,
PROMPT_KEYSTORE_FILE_NAME,
PROMPT_LEDGER_LOCATION,
PROMPT_NGINX_PROTECT_CORE_API,
PROMPT_ENABLE_GATEWAY,
PROMPT_GATEWAY_CORE_API_URL,
PROMPT_GATEWAY_CORE_API_NAME,
PROMPT_POSTGRES_LOCAL_REMOTE,
PROMPT_POSTGRES_REMOTE_URL,
PROMPT_POSTGRES_REMOTE_PORT,
PROMPT_POSTGRES_DATABASE_NAME,
PROMPT_POSTGRES_USERNAME,
PROMPT_POSTGRES_PASSWORD,
PROMPT_GATEWAY_IMAGE_VERSION,
PROMPT_MIGRATION_IMAGE_VERSION,
PROMPT_AGGREGATOR_IMAGE_VERSION,
PROMPT_NGINX_PROTECT_GATEWAY,
PROMPT_NGINX_IMAGE_VERSION,
PROMPT_CONFIRM_CONFIG,
],
):
with patch(
"sys.argv",
[
"main",
"docker",
"config",
"-m",
"DETAILED",
"-k",
"radix",
"-nk",
"-t",
"asdasd",
],
):
> main()
tests/unit/test_prompt_feeder_local.py:84:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
babylonnode.py:93: in main
dockercli_args.func(dockercli_args)
commands/dockercommand.py:197: in config
docker_config = DockerSetup.questionary(argument_object)
setup/DockerSetup.py:363: in questionary
if docker_config.common_config.check_nginx_required():
config/CommonDockerConfig.py:73: in check_nginx_required
if json.loads(self.nginx_settings.protect_core.lower()):
/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/json/__init__.py:346: in loads
return _default_decoder.decode(s)
/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/json/decoder.py:337: in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <json.decoder.JSONDecoder object at 0x7f9fbe49c9a0>, s = 'y', idx = 0
def raw_decode(self, s, idx=0):
"""Decode a JSON document from ``s`` (a ``str`` beginning with
a JSON document) and return a 2-tuple of the Python
representation and the index in ``s`` where the document ended.
This can be used to decode a JSON document from a string that may
have extraneous data at the end.
"""
try:
obj, end = self.scan_once(s, idx)
except StopIteration as err:
> raise JSONDecodeError("Expecting value", s, err.value) from None
E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/json/decoder.py:355: JSONDecodeError
Check warning on line 0 in tests.unit.test_systemd.SystemdUnitTests
github-actions / Test Results
test_systemd_setup_default_config (tests.unit.test_systemd.SystemdUnitTests) failed
node-runner-cli/junit/test-results.xml [took 0s]
Raw output
AssertionError: '# WA[226 chars]org\n\nnetwork.id=1\n\nnode.key.path=/home/rad[498 chars]ress' != '# WA[226 chars]org\ndownload_community_snapshot=true\nnetwork[530 chars]ress'
# WARNING!! This file is automatically generated and it is
# overriden when on install/update commands.
# Please consider re-running config/install commands rather
# than manually edit this file
ntp=false
ntp.pool=pool.ntp.org
-
+ download_community_snapshot=true
network.id=1
node.key.path=/home/radixdlt/babylon-node-config/node-keystore.ks
node.key.create_if_missing=true
network.p2p.broadcast_port=30000
network.p2p.listen_port=30001
network.p2p.seed_nodes=someNode
network.p2p.use_proxy_protocol=false
network.host_ip=1.1.1.1
log.level=debug
api.port=3333
api.transactions.enable=true
api.sign.enable=true
api.bind.address=0.0.0.0
api.system.port=3334
api.system.bind_address=0.0.0.0
db.location=/home/radixdlt/babylon-ledger
consensus.validator_address=validatorAddress
self = <tests.unit.test_systemd.SystemdUnitTests testMethod=test_systemd_setup_default_config>
mockout = <_io.StringIO object at 0x7f9fbade6a70>
@patch("sys.stdout", new_callable=StringIO)
def test_systemd_setup_default_config(self, mockout):
with patch("builtins.input", side_effect=[]):
config = SystemDConfig({})
config.common_config.host_ip = "1.1.1.1"
config.common_config.network_id = 1
config.core_node.keydetails.keyfile_path = (
"/home/radixdlt/babylon-node-config"
)
config.core_node.keydetails.keyfile_name = "node-keystore.ks"
config.core_node.trusted_node = "someNode"
config.core_node.validator_address = "validatorAddress"
config.core_node.node_dir = "/tmp"
config.migration.use_olympia = False
config.create_default_config_file("")
self.assertTrue(os.path.isfile("/tmp/default.config"))
f = open("/tmp/default.config", "r")
default_config = f.read()
fixture = """# WARNING!! This file is automatically generated and it is
# overriden when on install/update commands.
# Please consider re-running config/install commands rather
# than manually edit this file
ntp=false
ntp.pool=pool.ntp.org
network.id=1
node.key.path=/home/radixdlt/babylon-node-config/node-keystore.ks
node.key.create_if_missing=true
network.p2p.broadcast_port=30000
network.p2p.listen_port=30001
network.p2p.seed_nodes=someNode
network.p2p.use_proxy_protocol=false
network.host_ip=1.1.1.1
log.level=debug
api.port=3333
api.transactions.enable=true
api.sign.enable=true
api.bind.address=0.0.0.0
api.system.port=3334
api.system.bind_address=0.0.0.0
db.location=/home/radixdlt/babylon-ledger
consensus.validator_address=validatorAddress"""
self.maxDiff = None
print(fixture)
> self.assertEqual(fixture.strip(), default_config.strip())
E AssertionError: '# WA[226 chars]org\n\nnetwork.id=1\n\nnode.key.path=/home/rad[498 chars]ress' != '# WA[226 chars]org\ndownload_community_snapshot=true\nnetwork[530 chars]ress'
E # WARNING!! This file is automatically generated and it is
E # overriden when on install/update commands.
E # Please consider re-running config/install commands rather
E # than manually edit this file
E
E ntp=false
E ntp.pool=pool.ntp.org
E -
E + download_community_snapshot=true
E network.id=1
E
E node.key.path=/home/radixdlt/babylon-node-config/node-keystore.ks
E node.key.create_if_missing=true
E
E network.p2p.broadcast_port=30000
E network.p2p.listen_port=30001
E network.p2p.seed_nodes=someNode
E network.p2p.use_proxy_protocol=false
E network.host_ip=1.1.1.1
E
E log.level=debug
E
E api.port=3333
E api.transactions.enable=true
E api.sign.enable=true
E api.bind.address=0.0.0.0
E
E api.system.port=3334
E api.system.bind_address=0.0.0.0
E
E db.location=/home/radixdlt/babylon-ledger
E
E consensus.validator_address=validatorAddress
tests/unit/test_systemd.py:212: AssertionError
Check warning on line 0 in tests.unit.test_systemd.SystemdUnitTests
github-actions / Test Results
test_systemd_setup_default_config_jinja (tests.unit.test_systemd.SystemdUnitTests) failed
node-runner-cli/junit/test-results.xml [took 0s]
Raw output
AssertionError: '# WA[226 chars]org\n\nnetwork.id=1\n\nnode.key.path=/home/rad[498 chars]ress' != '# WA[226 chars]org\ndownload_community_snapshot=true\nnetwork[530 chars]ress'
# WARNING!! This file is automatically generated and it is
# overriden when on install/update commands.
# Please consider re-running config/install commands rather
# than manually edit this file
ntp=false
ntp.pool=pool.ntp.org
-
+ download_community_snapshot=true
network.id=1
node.key.path=/home/radixdlt/babylon-node-config/node-keystore.ks
node.key.create_if_missing=true
network.p2p.broadcast_port=30000
network.p2p.listen_port=30001
network.p2p.seed_nodes=someNode
network.p2p.use_proxy_protocol=false
network.host_ip=1.1.1.1
log.level=debug
api.port=3333
api.transactions.enable=true
api.sign.enable=true
api.bind.address=0.0.0.0
api.system.port=3334
api.system.bind_address=0.0.0.0
db.location=/home/radixdlt/babylon-ledger
consensus.validator_address=validatorAddress
self = <tests.unit.test_systemd.SystemdUnitTests testMethod=test_systemd_setup_default_config_jinja>
mockout = <_io.StringIO object at 0x7f9fbade91b0>
@patch("sys.stdout", new_callable=StringIO)
def test_systemd_setup_default_config_jinja(self, mockout):
with patch("builtins.input", side_effect=[]):
settings = SystemDConfig({})
settings.common_config.genesis_bin_data_file = None
settings.core_node.keydetails.keyfile_path = (
"/home/radixdlt/babylon-node-config"
)
settings.core_node.keydetails.keyfile_name = "node-keystore.ks"
settings.core_node.trusted_node = "someNode"
settings.common_config.host_ip = "1.1.1.1"
settings.common_config.network_id = 1
settings.core_node.validator_address = "validatorAddress"
settings.migration.use_olympia = False
render_template = (
Renderer()
.load_file_based_template("systemd-default.config.j2")
.render(settings.to_dict())
.rendered
)
fixture = """# WARNING!! This file is automatically generated and it is
# overriden when on install/update commands.
# Please consider re-running config/install commands rather
# than manually edit this file
ntp=false
ntp.pool=pool.ntp.org
network.id=1
node.key.path=/home/radixdlt/babylon-node-config/node-keystore.ks
node.key.create_if_missing=true
network.p2p.broadcast_port=30000
network.p2p.listen_port=30001
network.p2p.seed_nodes=someNode
network.p2p.use_proxy_protocol=false
network.host_ip=1.1.1.1
log.level=debug
api.port=3333
api.transactions.enable=true
api.sign.enable=true
api.bind.address=0.0.0.0
api.system.port=3334
api.system.bind_address=0.0.0.0
db.location=/home/radixdlt/babylon-ledger
consensus.validator_address=validatorAddress
"""
self.maxDiff = None
> self.assertEqual(fixture.strip(), render_template.strip())
E AssertionError: '# WA[226 chars]org\n\nnetwork.id=1\n\nnode.key.path=/home/rad[498 chars]ress' != '# WA[226 chars]org\ndownload_community_snapshot=true\nnetwork[530 chars]ress'
E # WARNING!! This file is automatically generated and it is
E # overriden when on install/update commands.
E # Please consider re-running config/install commands rather
E # than manually edit this file
E
E ntp=false
E ntp.pool=pool.ntp.org
E -
E + download_community_snapshot=true
E network.id=1
E
E node.key.path=/home/radixdlt/babylon-node-config/node-keystore.ks
E node.key.create_if_missing=true
E
E network.p2p.broadcast_port=30000
E network.p2p.listen_port=30001
E network.p2p.seed_nodes=someNode
E network.p2p.use_proxy_protocol=false
E network.host_ip=1.1.1.1
E
E log.level=debug
E
E api.port=3333
E api.transactions.enable=true
E api.sign.enable=true
E api.bind.address=0.0.0.0
E
E api.system.port=3334
E api.system.bind_address=0.0.0.0
E
E db.location=/home/radixdlt/babylon-ledger
E
E consensus.validator_address=validatorAddress
tests/unit/test_systemd.py:321: AssertionError
Check warning on line 0 in tests.unit.test_systemd.SystemdUnitTests
github-actions / Test Results
test_systemd_setup_default_config_without_validator (tests.unit.test_systemd.SystemdUnitTests) failed
node-runner-cli/junit/test-results.xml [took 0s]
Raw output
AssertionError: '# WA[226 chars]org\ndownload_community_snapshot=true\nnetwork[482 chars]dger' != '# WA[226 chars]org\n\nnetwork.id=1\n\nnode.key.path=/home/rad[450 chars]dger'
# WARNING!! This file is automatically generated and it is
# overriden when on install/update commands.
# Please consider re-running config/install commands rather
# than manually edit this file
ntp=false
ntp.pool=pool.ntp.org
- download_community_snapshot=true
+
network.id=1
node.key.path=/home/radixdlt/babylon-node-config/node-keystore.ks
node.key.create_if_missing=true
network.p2p.broadcast_port=30000
network.p2p.listen_port=30001
network.p2p.seed_nodes=someNode
network.p2p.use_proxy_protocol=false
network.host_ip=1.1.1.1
log.level=debug
api.port=3333
api.transactions.enable=true
api.sign.enable=true
api.bind.address=0.0.0.0
api.system.port=3334
api.system.bind_address=0.0.0.0
db.location=/home/radixdlt/babylon-ledger
self = <tests.unit.test_systemd.SystemdUnitTests testMethod=test_systemd_setup_default_config_without_validator>
mockout = <_io.StringIO object at 0x7f9fbade8d30>
@patch("sys.stdout", new_callable=StringIO)
def test_systemd_setup_default_config_without_validator(self, mockout):
with patch("builtins.input", side_effect=[]):
settings = SystemDConfig({})
settings.common_config.host_ip = "1.1.1.1"
settings.common_config.network_id = 1
settings.core_node.keydetails.keyfile_path = (
"/home/radixdlt/babylon-node-config"
)
settings.core_node.keydetails.keyfile_name = "node-keystore.ks"
settings.core_node.trusted_node = "someNode"
settings.core_node.validator_address = None
settings.core_node.node_dir = "/tmp"
settings.create_default_config_file("")
self.assertTrue(os.path.isfile("/tmp/default.config"))
f = open("/tmp/default.config", "r")
default_config = f.read()
fixture = """ # WARNING!! This file is automatically generated and it is
# overriden when on install/update commands.
# Please consider re-running config/install commands rather
# than manually edit this file
ntp=false
ntp.pool=pool.ntp.org
network.id=1
node.key.path=/home/radixdlt/babylon-node-config/node-keystore.ks
node.key.create_if_missing=true
network.p2p.broadcast_port=30000
network.p2p.listen_port=30001
network.p2p.seed_nodes=someNode
network.p2p.use_proxy_protocol=false
network.host_ip=1.1.1.1
log.level=debug
api.port=3333
api.transactions.enable=true
api.sign.enable=true
api.bind.address=0.0.0.0
api.system.port=3334
api.system.bind_address=0.0.0.0
db.location=/home/radixdlt/babylon-ledger
"""
self.maxDiff = None
> self.assertEqual(default_config.strip(), fixture.strip())
E AssertionError: '# WA[226 chars]org\ndownload_community_snapshot=true\nnetwork[482 chars]dger' != '# WA[226 chars]org\n\nnetwork.id=1\n\nnode.key.path=/home/rad[450 chars]dger'
E # WARNING!! This file is automatically generated and it is
E # overriden when on install/update commands.
E # Please consider re-running config/install commands rather
E # than manually edit this file
E
E ntp=false
E ntp.pool=pool.ntp.org
E - download_community_snapshot=true
E +
E network.id=1
E
E node.key.path=/home/radixdlt/babylon-node-config/node-keystore.ks
E node.key.create_if_missing=true
E
E network.p2p.broadcast_port=30000
E network.p2p.listen_port=30001
E network.p2p.seed_nodes=someNode
E network.p2p.use_proxy_protocol=false
E network.host_ip=1.1.1.1
E
E log.level=debug
E
E api.port=3333
E api.transactions.enable=true
E api.sign.enable=true
E api.bind.address=0.0.0.0
E
E api.system.port=3334
E api.system.bind_address=0.0.0.0
E
E db.location=/home/radixdlt/babylon-ledger
tests/unit/test_systemd.py:264: AssertionError