From e538f3b8b882d3cef6de660a576695b052237a0a Mon Sep 17 00:00:00 2001 From: dkijania Date: Wed, 18 Dec 2024 20:07:48 +0100 Subject: [PATCH] Do not use magic config file in integration tests --- .../integration_test_local_engine/docker_node_config.ml | 8 +++++++- src/lib/integration_test_local_engine/mina_docker.ml | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/integration_test_local_engine/docker_node_config.ml b/src/lib/integration_test_local_engine/docker_node_config.ml index 16bba170998..c9b4d013ce3 100644 --- a/src/lib/integration_test_local_engine/docker_node_config.ml +++ b/src/lib/integration_test_local_engine/docker_node_config.ml @@ -81,10 +81,16 @@ module Base_node_config = struct let container_libp2p_key_path = container_keys_path ^ "/libp2p_key" - let entrypoint_script = + let magic_config_file commit_id = Printf.sprintf "/var/lib/coda/config_%s.json" commit_id + + + let entrypoint_script commit_id = ( "entrypoint.sh" , {|#!/bin/bash # This file is auto-generated by the local integration test framework. + # Remove magic config file which is loaded by default when daemon is starting. + # It can influence final config file + rm |} ^ (magic_config_file commit_id) ^ {| # Path to the libp2p_key file LIBP2P_KEY_PATH="|} ^ container_libp2p_key_path diff --git a/src/lib/integration_test_local_engine/mina_docker.ml b/src/lib/integration_test_local_engine/mina_docker.ml index 6b23207352e..6bbb731c1d7 100644 --- a/src/lib/integration_test_local_engine/mina_docker.ml +++ b/src/lib/integration_test_local_engine/mina_docker.ml @@ -43,6 +43,7 @@ module Network_config = struct map )] ) ; constants : Test_config.constants ; docker : docker_config + ; commit_id: string } [@@deriving to_yojson] @@ -325,7 +326,7 @@ module Network_config = struct Base_node_config.default ~peer:None ~runtime_config_path: (Some Base_node_config.container_runtime_config_path) - ~start_filtered_logs + ~start_filtered_logs } in Seed_config.create @@ -543,6 +544,7 @@ module Network_config = struct { debug_arg = debug ; genesis_keypairs ; constants + ; commit_id = git_commit ; docker = { docker_swarm_version ; stack_name @@ -729,7 +731,7 @@ module Network_manager = struct "Writing custom entrypoint script (libp2p key generation and puppeteer \ context)" ; let entrypoint_filename, entrypoint_script = - Docker_node_config.Base_node_config.entrypoint_script + Docker_node_config.Base_node_config.entrypoint_script network_config.commit_id in Out_channel.with_file ~fail_if_exists:true (docker_dir ^/ entrypoint_filename) ~f:(fun ch ->