diff --git a/README.md b/README.md index 3b1773563..ade5cd475 100644 --- a/README.md +++ b/README.md @@ -473,8 +473,12 @@ assertoor_params: run_lifecycle_test: false # Run additional tests from external test definitions + # Entries may be simple strings (link to the test file) or dictionaries with more flexibility # eg: # - https://raw.githubusercontent.com/ethpandaops/assertoor/master/example/tests/block-proposal-check.yaml + # - file: "https://raw.githubusercontent.com/ethpandaops/assertoor/master/example/tests/block-proposal-check.yaml" + # config: + # someCustomTestConfig: "some value" tests: [] diff --git a/src/assertoor/assertoor_launcher.star b/src/assertoor/assertoor_launcher.star index 94a73d0cc..35c206412 100644 --- a/src/assertoor/assertoor_launcher.star +++ b/src/assertoor/assertoor_launcher.star @@ -137,6 +137,19 @@ def get_config( def new_config_template_data( listen_port_num, client_info, validator_client_info, assertoor_params ): + additional_tests = [] + for index, testcfg in enumerate(assertoor_params.tests): + if type(testcfg) == "dict": + additional_tests.append(json.encode(testcfg)) + else: + additional_tests.append( + json.encode( + { + "file": testcfg, + } + ) + ) + return { "ListenPortNum": listen_port_num, "ClientInfo": client_info, @@ -147,7 +160,7 @@ def new_config_template_data( "RunTransactionTest": assertoor_params.run_transaction_test, "RunBlobTransactionTest": assertoor_params.run_blob_transaction_test, "RunOpcodesTransactionTest": assertoor_params.run_opcodes_transaction_test, - "AdditionalTests": assertoor_params.tests, + "AdditionalTests": additional_tests, } diff --git a/static_files/assertoor-config/config.yaml.tmpl b/static_files/assertoor-config/config.yaml.tmpl index e43e27a3e..1feeaa584 100644 --- a/static_files/assertoor-config/config.yaml.tmpl +++ b/static_files/assertoor-config/config.yaml.tmpl @@ -51,5 +51,5 @@ externalTests: - file: /tests/validator-lifecycle-test.yaml {{ end }} {{ range $test := .AdditionalTests }} -- file: "{{ $test }}" +- {{ $test }} {{- end }}