From 7e6603c707eca8df4ba874960696fac580d1dcaf Mon Sep 17 00:00:00 2001 From: Marc Cunningham Date: Mon, 24 Jun 2024 14:23:27 -0700 Subject: [PATCH] Add logging for canary auto generation --- src/rpdk/core/project.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rpdk/core/project.py b/src/rpdk/core/project.py index 38c7ffd9..94078ef3 100644 --- a/src/rpdk/core/project.py +++ b/src/rpdk/core/project.py @@ -1323,9 +1323,12 @@ def generate_canary_files(self) -> None: not self.file_generation_enabled or not Path(self.target_contract_test_folder_path).exists() ): + LOG.info("Skipping Canary Auto-Generation") return + LOG.info("Starting Canary Auto-Generation...") self._setup_stack_template_environment() self._generate_stack_template_files() + LOG.info("Finished Canary Auto-Generation") def _setup_stack_template_environment(self) -> None: stack_template_root = Path(self.target_canary_root_path) @@ -1337,7 +1340,12 @@ def _setup_stack_template_environment(self) -> None: ) bootstrap_file = stack_template_root / CANARY_DEPENDENCY_FILE_NAME if dependencies_file.exists(): + LOG.debug("Writing: %s", bootstrap_file) shutil.copy(str(dependencies_file), str(bootstrap_file)) + else: + LOG.debug( + "Not found: %s. Not writing to: %s", dependencies_file, bootstrap_file + ) def _generate_stack_template_files(self) -> None: stack_template_folder = Path(self.target_canary_folder_path) @@ -1349,6 +1357,7 @@ def _generate_stack_template_files(self) -> None: ] contract_test_files = sorted(contract_test_files) for count, ct_file in enumerate(contract_test_files, start=1): + LOG.debug("Loading contract test input file: %s", ct_file) with ct_file.open("r") as f: json_data = json.load(f) resource_name = self.type_info[2] @@ -1398,6 +1407,7 @@ def _save_stack_template_data( f"{CANARY_FILE_PREFIX}{contract_test_input_count}_{suffix}.yaml" ) stack_template_file_path = stack_template_folder / stack_template_file_name + LOG.debug("Writing Canary Stack Template File: %s", stack_template_file_path) with stack_template_file_path.open("w") as stack_template_file: yaml.dump(stack_template_data, stack_template_file, indent=2)