Skip to content

Commit

Permalink
hotfix for passing task tests for cli command
Browse files Browse the repository at this point in the history
  • Loading branch information
asampat3090 committed May 1, 2018
1 parent 38823b7 commit ec5168c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
8 changes: 3 additions & 5 deletions datmo/cli/command/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from datmo.core.util.i18n import get as __
from datmo.cli.command.project import ProjectCommand
from datmo.core.controller.task import TaskController
from datmo.core.util.exceptions import RequiredArgumentMissing


class TaskCommand(ProjectCommand):
Expand Down Expand Up @@ -53,18 +52,17 @@ def run(self, **kwargs):
kwargs['environment_definition_filepath']
}

cmd = []
if not isinstance(kwargs['cmd'], list):
if platform.system() == "Windows":
cmd = kwargs['cmd']
kwargs['cmd'] = kwargs['cmd']
else:
cmd = shlex.split(kwargs['cmd'])
kwargs['cmd'] = shlex.split(kwargs['cmd'])

task_dict = {
"gpu": kwargs['gpu'],
"ports": kwargs['ports'],
"interactive": kwargs['interactive'],
"command": cmd
"command": kwargs['cmd']
}

# Create the task object
Expand Down
1 change: 1 addition & 0 deletions datmo/cli/command/test/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def test_task_stop(self):
assert task_stop_command == True

def test_task_stop_invalid_task_id(self):
self.__set_variables()
# Passing wrong task id
self.task.parse([
"task",
Expand Down
2 changes: 2 additions & 0 deletions datmo/core/controller/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def cleanup(self):
self.model.name)
image_id = images[0].id if images else None

import pdb; pdb.set_trace()

# Remove Datmo code_driver references
self.code_driver.delete_code_refs_dir()

Expand Down
2 changes: 1 addition & 1 deletion datmo/core/controller/test/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_cleanup(self):
result = self.project.cleanup()
assert not self.project.code_driver.exists_code_refs_dir()
assert not self.project.file_driver.exists_datmo_file_structure()
assert not self.project.environment_driver.list_images("datmo-test")
assert not self.project.environment_driver.list_images("datmo-test2")
# Ensure that containers built with this image do not exist
# assert not self.project.environment_driver.list_containers(filters={
# "ancestor": image_id
Expand Down

0 comments on commit ec5168c

Please sign in to comment.