Skip to content

Commit

Permalink
Fix bug in test scenario parsing due to deepcopy
Browse files Browse the repository at this point in the history
  • Loading branch information
TaekyungHeo committed Aug 21, 2024
1 parent 4ac2e21 commit 5b1c08a
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/cloudai/_core/test_scenario_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,30 @@ def _create_section_test(self, section: str, test_info: Dict[str, Any]) -> Test:
f"reference from the test scenario schema."
)

test = copy.deepcopy(self.test_mapping[test_name])
test.test_template = self.test_mapping[test_name].test_template
original_test = self.test_mapping[test_name]

test = Test(
name=original_test.name,
description=original_test.description,
test_template=original_test.test_template,
env_vars=copy.deepcopy(original_test.env_vars),
cmd_args=copy.deepcopy(original_test.cmd_args),
extra_env_vars=copy.deepcopy(original_test.extra_env_vars),
extra_cmd_args=original_test.extra_cmd_args,
dependencies=copy.deepcopy(original_test.dependencies),
iterations=original_test.iterations,
num_nodes=original_test.num_nodes,
nodes=original_test.nodes,
sol=original_test.sol,
weight=original_test.weight,
ideal_perf=original_test.ideal_perf,
time_limit=original_test.time_limit,
)

test.section_name = section
test.num_nodes = int(test_info.get("num_nodes", 1))
test.nodes = test_info.get("nodes", [])

return test

def _parse_dependencies_for_test(
Expand Down

0 comments on commit 5b1c08a

Please sign in to comment.