Skip to content

Commit

Permalink
Do not use magic config file in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dkijania committed Dec 19, 2024
1 parent 01e9983 commit 83711be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/lib/integration_test_local_engine/docker_node_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,19 @@ 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.
#
# Removes magic config file which is loaded by default when daemon is starting.
# It can influence final config file, so we need to remove it before starting process
rm -f |}
^ magic_config_file commit_id
^ {|
# Path to the libp2p_key file
LIBP2P_KEY_PATH="|}
^ container_libp2p_key_path
Expand Down
3 changes: 3 additions & 0 deletions src/lib/integration_test_local_engine/mina_docker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module Network_config = struct
map )] )
; constants : Test_config.constants
; docker : docker_config
; commit_id : string
}
[@@deriving to_yojson]

Expand Down Expand Up @@ -543,6 +544,7 @@ module Network_config = struct
{ debug_arg = debug
; genesis_keypairs
; constants
; commit_id = git_commit
; docker =
{ docker_swarm_version
; stack_name
Expand Down Expand Up @@ -730,6 +732,7 @@ module Network_manager = struct
context)" ;
let entrypoint_filename, 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 ->
Expand Down

0 comments on commit 83711be

Please sign in to comment.