Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use magic config file in integration tests #16441

Open
wants to merge 1 commit into
base: compatible
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
#
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder, could we just provide more overrides in integration test code instead of crude removal. P.S. in a med-term we want to get rid of this config discovery in a docker image.

# 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