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 18, 2024
1 parent 01e9983 commit e538f3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 7 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,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
Expand Down
6 changes: 4 additions & 2 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 @@ -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
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 @@ -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 ->
Expand Down

0 comments on commit e538f3b

Please sign in to comment.