Skip to content

Commit

Permalink
fixes for tests breaking on agent due to paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ankona committed Oct 21, 2024
1 parent a39246e commit 8593491
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion smartsim/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def start(self, *jobs: Job | t.Sequence[Job]) -> tuple[LaunchedJobID, ...]:
jobs_ = list(_helpers.unpack(jobs))

run_id = datetime.datetime.now().replace(microsecond=0).isoformat()
root = pathlib.Path(self.exp_path, run_id)
root = pathlib.Path(self.exp_path, run_id.replace(":", "."))
return self._dispatch(Generator(root), dispatch.DEFAULT_DISPATCHER, *jobs_)

def _dispatch(
Expand Down
13 changes: 5 additions & 8 deletions tests/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,15 @@ def as_executable_sequence(self):
def mock_job() -> unittest.mock.MagicMock:
"""Fixture to create a mock Job."""
job = unittest.mock.MagicMock(
**{
"entity": EchoHelloWorldEntity(),
"name": "test_job",
"get_launch_steps": unittest.mock.MagicMock(
side_effect=lambda: NotImplementedError()
),
},
entity=EchoHelloWorldEntity(),
name="test_job",
get_launch_steps=unittest.mock.MagicMock(
side_effect=lambda: NotImplementedError()
),
spec=Job,
)
yield job


# UNIT TESTS


Expand Down

0 comments on commit 8593491

Please sign in to comment.