aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject git commit: Part 2 of converting from Packages to Metadata (client)
Date Wed, 02 Apr 2014 17:29:25 GMT
Repository: incubator-aurora
Updated Branches:
  refs/heads/master 85ae33ba3 -> 6cdc53806


Part 2 of converting from Packages to Metadata (client)

Bugs closed: AURORA-158

Reviewed at https://reviews.apache.org/r/19895/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/6cdc5380
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/6cdc5380
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/6cdc5380

Branch: refs/heads/master
Commit: 6cdc53806c013aafa55c6f94858c47f1ba6bfb3a
Parents: 85ae33b
Author: Maxim Khutornenko <maxim@apache.org>
Authored: Wed Apr 2 10:28:55 2014 -0700
Committer: Maxim Khutornenko <maxim@apache.org>
Committed: Wed Apr 2 10:28:55 2014 -0700

----------------------------------------------------------------------
 .../python/apache/aurora/client/cli/jobs.py     |  9 ++++----
 .../apache/aurora/client/commands/core.py       | 11 ++++------
 .../python/apache/aurora/config/__init__.py     | 12 ++++-------
 src/main/python/apache/aurora/config/thrift.py  | 12 ++++-------
 .../apache/aurora/client/api/test_updater.py    |  8 +++----
 .../apache/aurora/client/cli/test_diff.py       |  2 +-
 .../apache/aurora/client/cli/test_status.py     | 22 ++++++++++----------
 .../apache/aurora/client/cli/test_task_run.py   |  4 ++--
 .../apache/aurora/client/commands/test_diff.py  |  2 +-
 .../apache/aurora/client/commands/test_run.py   |  2 +-
 .../apache/aurora/client/commands/test_ssh.py   |  2 +-
 .../aurora/client/commands/test_status.py       | 16 +++++++-------
 .../python/apache/aurora/config/test_thrift.py  | 15 +++++++------
 13 files changed, 52 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/main/python/apache/aurora/client/cli/jobs.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/cli/jobs.py b/src/main/python/apache/aurora/client/cli/jobs.py
index e354ee1..798f54d 100644
--- a/src/main/python/apache/aurora/client/cli/jobs.py
+++ b/src/main/python/apache/aurora/client/cli/jobs.py
@@ -488,11 +488,10 @@ The jobspec parameter can omit parts of the jobkey, or use shell-style
globs."""
       for event in scheduled_task.taskEvents:
         task_strings.append('\t %s %s: %s' % (datetime.fromtimestamp(event.timestamp / 1000),
             ScheduleStatus._VALUES_TO_NAMES[event.status], event.message))
-        task_strings.append('packages:')
-        if assigned_task.task.packagesDEPRECATED is not None:
-          for pkg in assigned_task.task.packagesDEPRECATED:
-            task_strings.append('\trole: %s, package: %s, version: %s' %
-                (pkg.role, pkg.name, pkg.version))
+        task_strings.append('metadata:')
+        if assigned_task.task.metadata is not None:
+          for md in assigned_task.task.metadata:
+            task_strings.append('\t%s: %s' % (md.key, md.value))
       return '\n\t'.join(task_strings)
 
     result = ["Active tasks (%s):\n" % len(active_tasks)]

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/main/python/apache/aurora/client/commands/core.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/client/commands/core.py b/src/main/python/apache/aurora/client/commands/core.py
index 8fa26a6..b1abc9e 100644
--- a/src/main/python/apache/aurora/client/commands/core.py
+++ b/src/main/python/apache/aurora/client/commands/core.py
@@ -452,10 +452,10 @@ def status(args, options):
       taskString += '\n\t\t %s %s: %s' % (datetime.fromtimestamp(event.timestamp / 1000),
                                           ScheduleStatus._VALUES_TO_NAMES[event.status],
                                           event.message)
-    taskString += '\n\tpackages:'
-    if assigned_task.task.packagesDEPRECATED is not None:
-      for pkg in assigned_task.task.packagesDEPRECATED:
-        taskString += ('\n\t\trole: %s, package: %s, version: %s' % (pkg.role, pkg.name,
pkg.version))
+    taskString += '\n\tmetadata:'
+    if assigned_task.task.metadata is not None:
+      for md in assigned_task.task.metadata:
+        taskString += ('\n\t\t%s: %s' % (md.key, md.value))
 
     return taskString
 
@@ -471,9 +471,6 @@ def status(args, options):
               ScheduleStatus._VALUES_TO_NAMES[task.status],
               task.assignedTask.slaveHost,
               taskString))
-      if task.assignedTask.task.packagesDEPRECATED is not None:
-        for pkg in task.assignedTask.task.packagesDEPRECATED:
-          log.info('\tpackage %s/%s/%s' % (pkg.role, pkg.name, pkg.version))
 
   api, job_key, _ = LiveJobDisambiguator.disambiguate_args_or_die(
       args, options, make_client_factory())

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/main/python/apache/aurora/config/__init__.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/config/__init__.py b/src/main/python/apache/aurora/config/__init__.py
index 58dff95..74e6b21 100644
--- a/src/main/python/apache/aurora/config/__init__.py
+++ b/src/main/python/apache/aurora/config/__init__.py
@@ -162,7 +162,7 @@ class AuroraConfig(object):
   def __init__(self, job):
     self.validate_job(job)
     self._job = self.standard_bindings(job)
-    self._packages = []
+    self._metadata = []
     self.binding_dicts = defaultdict(dict)
     self.hooks = []
 
@@ -193,7 +193,7 @@ class AuroraConfig(object):
       raise self.InvalidConfig(typecheck.message())
     interpolated_job = interpolated_job(task_links=self.task_links())
     try:
-      return convert_thrift(interpolated_job, self._packages, self.ports())
+      return convert_thrift(interpolated_job, self._metadata, self.ports())
     except InvalidThriftConfig as e:
       raise self.InvalidConfig(str(e))
 
@@ -273,12 +273,8 @@ class AuroraConfig(object):
   def update_config(self):
     return self._job.update_config()
 
-  def add_package(self, package):
-    self._packages.append(package)
-
-  # TODO(wickman) Kill package() once MESOS-3191 is in.
-  def package(self):
-    pass
+  def add_metadata(self, key, value):
+    self._metadata.append((key, value))
 
   def is_dedicated(self):
     return self._job.has_constraints() and 'dedicated' in self._job.constraints()

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/main/python/apache/aurora/config/thrift.py
----------------------------------------------------------------------
diff --git a/src/main/python/apache/aurora/config/thrift.py b/src/main/python/apache/aurora/config/thrift.py
index 47f592f..4cc0f07 100644
--- a/src/main/python/apache/aurora/config/thrift.py
+++ b/src/main/python/apache/aurora/config/thrift.py
@@ -33,7 +33,7 @@ from gen.apache.aurora.ttypes import (
   JobConfiguration,
   JobKey,
   LimitConstraint,
-  Package,
+  Metadata,
   TaskConfig,
   TaskConstraint,
   ValueConstraint,
@@ -182,9 +182,7 @@ THERMOS_PORT_SCOPE_REF = Ref.from_address('thermos.ports')
 THERMOS_TASK_ID_REF = Ref.from_address('thermos.task_id')
 
 
-# TODO(wickman) Make this a method directly on an AuroraConfig so that we don't
-# need the packages/ports shenanigans.
-def convert(job, packages=frozenset(), ports=frozenset()):
+def convert(job, metadata=frozenset(), ports=frozenset()):
   """Convert a Pystachio MesosJob to an Aurora Thrift JobConfiguration."""
 
   owner = Identity(role=fully_interpolated(job.role()), user=getpass.getuser())
@@ -210,10 +208,8 @@ def convert(job, packages=frozenset(), ports=frozenset()):
   task.priority = fully_interpolated(job.priority())
   task.contactEmail = not_empty_or(job.contact(), None)
 
-  # Add package tuples to a task, to display in the scheduler UI.
-  task.packagesDEPRECATED = frozenset(
-      Package(role=str(role), name=str(package_name), version=int(version))
-      for role, package_name, version in packages)
+  # Add metadata to a task, to display in the scheduler UI.
+  task.metadata = frozenset(Metadata(key=str(key), value=str(value)) for key, value in metadata)
 
   # task components
   if not task_raw.has_resources():

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/test/python/apache/aurora/client/api/test_updater.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/api/test_updater.py b/src/test/python/apache/aurora/client/api/test_updater.py
index 4a4971d..a5680a0 100644
--- a/src/test/python/apache/aurora/client/api/test_updater.py
+++ b/src/test/python/apache/aurora/client/api/test_updater.py
@@ -38,7 +38,7 @@ from gen.apache.aurora.ttypes import (
   Lock,
   LockKey,
   LockValidation,
-  Package,
+  Metadata,
   PopulateJobResult,
   ResourceAggregate,
   Response,
@@ -755,9 +755,9 @@ class UpdaterTest(TestCase):
         Constraint(name='value', constraint=ValueConstraint(values=set(['1', '2']))),
         Constraint(name='limit', constraint=TaskConstraint(limit=LimitConstraint(limit=int(10))))])
     from_config.taskLinks = {'task1': 'link1', 'task2': 'link2'}
-    from_config.packagesDEPRECATED = set([
-        Package(name='n2', role='r2', version=4),
-        Package(role='r1', name='n1', version=1)])
+    from_config.metadata = set([
+      Metadata(key='k2', value='v2'),
+      Metadata(key='k1', value='v1')])
     from_config.executorConfig = ExecutorConfig(name='test', data='test data')
     from_config.requestedPorts = set(['3424', '142', '45235'])
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/test/python/apache/aurora/client/cli/test_diff.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_diff.py b/src/test/python/apache/aurora/client/cli/test_diff.py
index f81e51d..fbfd3dd 100644
--- a/src/test/python/apache/aurora/client/cli/test_diff.py
+++ b/src/test/python/apache/aurora/client/cli/test_diff.py
@@ -71,7 +71,7 @@ class TestDiffCommand(AuroraClientCommandTest):
       job.assignedTask.task.maxTaskFailures = 1
       job.assignedTask.task.executorConfig = Mock(spec=ExecutorConfig)
       job.assignedTask.task.executorConfig.data = Mock()
-      job.assignedTask.task.packagesDEPRECATED = []
+      job.assignedTask.task.metadata = []
       job.assignedTask.task.owner = Identity(role='bozo')
       job.assignedTask.task.environment = 'test'
       job.assignedTask.task.jobName = 'woops'

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/test/python/apache/aurora/client/cli/test_status.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_status.py b/src/test/python/apache/aurora/client/cli/test_status.py
index e828f27..4813ce1 100644
--- a/src/test/python/apache/aurora/client/cli/test_status.py
+++ b/src/test/python/apache/aurora/client/cli/test_status.py
@@ -50,7 +50,7 @@ class TestJobStatus(AuroraClientCommandTest):
       job.assignedTask.slaveHost = 'slavehost'
       job.assignedTask.task = Mock(spec=TaskConfig)
       job.assignedTask.task.maxTaskFailures = 1
-      job.assignedTask.task.packagesDEPRECATED = []
+      job.assignedTask.task.metadata = []
       job.assignedTask.task.owner = Identity(role='bozo')
       job.assignedTask.task.environment = 'test'
       job.assignedTask.task.jobName = 'woops'
@@ -69,10 +69,10 @@ class TestJobStatus(AuroraClientCommandTest):
     return jobs
 
   @classmethod
-  def create_mock_scheduled_task_no_packages(cls):
+  def create_mock_scheduled_task_no_metadata(cls):
     result = cls.create_mock_scheduled_tasks()
     for job in result:
-      job.assignedTask.task.packagesDEPRECATED = None
+      job.assignedTask.task.metadata = None
     return result
 
   @classmethod
@@ -102,10 +102,10 @@ class TestJobStatus(AuroraClientCommandTest):
     return resp
 
   @classmethod
-  def create_status_response_null_package(cls):
+  def create_status_response_null_metadata(cls):
     resp = cls.create_simple_success_response()
     resp.result.scheduleStatusResult = Mock(spec=ScheduleStatusResult)
-    resp.result.scheduleStatusResult.tasks = set(cls.create_mock_scheduled_task_no_packages())
+    resp.result.scheduleStatusResult.tasks = set(cls.create_mock_scheduled_task_no_metadata())
     return resp
 
   @classmethod
@@ -124,12 +124,12 @@ class TestJobStatus(AuroraClientCommandTest):
       cmd.execute(['job', 'status', 'west/bozo/test/hello'])
       mock_api.check_status.assert_called_with(AuroraJobKey('west', 'bozo', 'test', 'hello'))
 
-  def test_successful_status_shallow_nopackages(self):
-    """Regression test: there was a crasher bug when packages was None."""
-    
+  def test_successful_status_shallow_nometadata(self):
+    """Regression test: there was a crasher bug when metadata was None."""
+
     mock_context = FakeAuroraCommandContext()
     mock_api = mock_context.get_api('west')
-    mock_api.check_status.return_value = self.create_status_response_null_package()
+    mock_api.check_status.return_value = self.create_status_response_null_metadata()
     with contextlib.nested(
         patch('apache.aurora.client.cli.jobs.Job.create_context', return_value=mock_context)):
       cmd = AuroraCommandLine()
@@ -149,9 +149,9 @@ class TestJobStatus(AuroraClientCommandTest):
       mock_scheduler_proxy.getTasksStatus.assert_called_with(TaskQuery(jobName='hello',
           environment='test', owner=Identity(role='bozo')))
 
-  def test_successful_status_deep_null_packages(self):
+  def test_successful_status_deep_null_metadata(self):
     (mock_api, mock_scheduler_proxy) = self.create_mock_api()
-    mock_scheduler_proxy.query.return_value = self.create_status_response_null_package()
+    mock_scheduler_proxy.query.return_value = self.create_status_response_null_metadata()
     with contextlib.nested(
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS)):

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/test/python/apache/aurora/client/cli/test_task_run.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/cli/test_task_run.py b/src/test/python/apache/aurora/client/cli/test_task_run.py
index 98dc52d..529fb40 100644
--- a/src/test/python/apache/aurora/client/cli/test_task_run.py
+++ b/src/test/python/apache/aurora/client/cli/test_task_run.py
@@ -50,7 +50,7 @@ class TestRunCommand(AuroraClientCommandTest):
       job.assignedTask.task = Mock(spec=TaskConfig)
       job.assignedTask.task.executorConfig = Mock()
       job.assignedTask.task.maxTaskFailures = 1
-      job.assignedTask.task.packagesDEPRECATED = []
+      job.assignedTask.task.metadata = []
       job.assignedTask.task.owner = Identity(role='bozo')
       job.assignedTask.task.environment = 'test'
       job.assignedTask.task.jobName = 'woops'
@@ -134,7 +134,7 @@ class TestSshCommand(AuroraClientCommandTest):
       job.assignedTask.task = Mock(spec=TaskConfig)
       job.assignedTask.task.executorConfig = Mock()
       job.assignedTask.task.maxTaskFailures = 1
-      job.assignedTask.task.packagesDEPRECATED = []
+      job.assignedTask.task.metadata = []
       job.assignedTask.task.owner = Identity(role='bozo')
       job.assignedTask.task.environment = 'test'
       job.assignedTask.task.jobName = 'woops'

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/test/python/apache/aurora/client/commands/test_diff.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_diff.py b/src/test/python/apache/aurora/client/commands/test_diff.py
index 2412d09..824397d 100644
--- a/src/test/python/apache/aurora/client/commands/test_diff.py
+++ b/src/test/python/apache/aurora/client/commands/test_diff.py
@@ -69,7 +69,7 @@ class TestDiffCommand(AuroraClientCommandTest):
       job.assignedTask.task.maxTaskFailures = 1
       job.assignedTask.task.executorConfig = Mock(spec=ExecutorConfig)
       job.assignedTask.task.executorConfig.data = Mock()
-      job.assignedTask.task.packagesDEPRECATED = []
+      job.assignedTask.task.metadata = []
       job.assignedTask.task.owner = Identity(role='mchucarroll')
       job.assignedTask.task.environment = 'test'
       job.assignedTask.task.jobName = 'woops'

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/test/python/apache/aurora/client/commands/test_run.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_run.py b/src/test/python/apache/aurora/client/commands/test_run.py
index b808ed2..61eff75 100644
--- a/src/test/python/apache/aurora/client/commands/test_run.py
+++ b/src/test/python/apache/aurora/client/commands/test_run.py
@@ -61,7 +61,7 @@ class TestRunCommand(AuroraClientCommandTest):
       job.assignedTask.task = Mock(spec=TaskConfig)
       job.assignedTask.task.executorConfig = Mock()
       job.assignedTask.task.maxTaskFailures = 1
-      job.assignedTask.task.packagesDEPRECATED = []
+      job.assignedTask.task.metadata = []
       job.assignedTask.task.owner = Identity(role='mchucarroll')
       job.assignedTask.task.environment = 'test'
       job.assignedTask.task.jobName = 'woops'

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/test/python/apache/aurora/client/commands/test_ssh.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_ssh.py b/src/test/python/apache/aurora/client/commands/test_ssh.py
index 656a334..dd62c9c 100644
--- a/src/test/python/apache/aurora/client/commands/test_ssh.py
+++ b/src/test/python/apache/aurora/client/commands/test_ssh.py
@@ -60,7 +60,7 @@ class TestSshCommand(AuroraClientCommandTest):
       job.assignedTask.task = Mock(spec=TaskConfig)
       job.assignedTask.task.executorConfig = Mock()
       job.assignedTask.task.maxTaskFailures = 1
-      job.assignedTask.task.packagesDEPRECATED = []
+      job.assignedTask.task.metadata = []
       job.assignedTask.task.owner = Identity(role='mchucarroll')
       job.assignedTask.task.environment = 'test'
       job.assignedTask.task.jobName = 'woops'

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/test/python/apache/aurora/client/commands/test_status.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/client/commands/test_status.py b/src/test/python/apache/aurora/client/commands/test_status.py
index a1f200f..400e8c2 100644
--- a/src/test/python/apache/aurora/client/commands/test_status.py
+++ b/src/test/python/apache/aurora/client/commands/test_status.py
@@ -58,7 +58,7 @@ class TestListJobs(AuroraClientCommandTest):
       job.assignedTask.slaveHost = 'slavehost'
       job.assignedTask.task = Mock(spec=TaskConfig)
       job.assignedTask.task.maxTaskFailures = 1
-      job.assignedTask.task.packagesDEPRECATED = []
+      job.assignedTask.task.metadata = []
       job.assignedTask.task.owner = Identity(role='mchucarroll')
       job.assignedTask.task.environment = 'test'
       job.assignedTask.task.jobName = 'woops'
@@ -77,10 +77,10 @@ class TestListJobs(AuroraClientCommandTest):
     return jobs
 
   @classmethod
-  def create_mock_scheduled_task_no_packages(cls):
+  def create_mock_scheduled_task_no_metadata(cls):
     result = cls.create_mock_scheduled_tasks()
     for job in result:
-      job.assignedTask.task.packagesDEPRECATED = None
+      job.assignedTask.task.metadata = None
     return result
 
   @classmethod
@@ -91,10 +91,10 @@ class TestListJobs(AuroraClientCommandTest):
     return resp
 
   @classmethod
-  def create_status_response_null_package(cls):
+  def create_status_response_null_metadata(cls):
     resp = cls.create_simple_success_response()
     resp.result.scheduleStatusResult = Mock(spec=ScheduleStatusResult)
-    resp.result.scheduleStatusResult.tasks = set(cls.create_mock_scheduled_task_no_packages())
+    resp.result.scheduleStatusResult.tasks = set(cls.create_mock_scheduled_task_no_metadata())
     return resp
 
   @classmethod
@@ -139,12 +139,12 @@ class TestListJobs(AuroraClientCommandTest):
       mock_scheduler_proxy.getTasksStatus.assert_called_with(TaskQuery(jobName='hello',
           environment='test', owner=Identity(role='mchucarroll')))
 
-  def test_successful_status_nopackages(self):
-    """Test the status command with no packages."""
+  def test_successful_status_nometadata(self):
+    """Test the status command with no metadata."""
     # Calls api.check_status, which calls scheduler_proxy.getJobs
     mock_options = self.setup_mock_options()
     (mock_api, mock_scheduler_proxy) = self.create_mock_api()
-    mock_scheduler_proxy.getTasksStatus.return_value = self.create_status_response_null_package()
+    mock_scheduler_proxy.getTasksStatus.return_value = self.create_status_response_null_metadata()
     with contextlib.nested(
         patch('apache.aurora.client.api.SchedulerProxy', return_value=mock_scheduler_proxy),
         patch('apache.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/6cdc5380/src/test/python/apache/aurora/config/test_thrift.py
----------------------------------------------------------------------
diff --git a/src/test/python/apache/aurora/config/test_thrift.py b/src/test/python/apache/aurora/config/test_thrift.py
index 3acd4cc..f845c98 100644
--- a/src/test/python/apache/aurora/config/test_thrift.py
+++ b/src/test/python/apache/aurora/config/test_thrift.py
@@ -79,7 +79,7 @@ def test_simple_config():
   assert tti.priority == 0
   assert tti.maxTaskFailures == 1
   assert tti.constraints == set()
-  assert tti.packagesDEPRECATED == set()
+  assert tti.metadata == set()
   assert tti.environment == HELLO_WORLD.environment().get()
 
 
@@ -207,16 +207,15 @@ def test_cron_policy_alias():
     tti = convert_pystachio_to_thrift(CRON_HELLO_WORLD(cron_collision_policy='GARBAGE'))
 
 
-def test_packages_in_config():
-  job = convert_pystachio_to_thrift(HELLO_WORLD, packages = [('alpha', 'beta', 1)])
+def test_metadata_in_config():
+  job = convert_pystachio_to_thrift(HELLO_WORLD, metadata=[('alpha', 1)])
   assert job.instanceCount == 1
   tti = job.taskConfig
 
-  assert len(tti.packagesDEPRECATED) == 1
-  pi = iter(tti.packagesDEPRECATED).next()
-  assert pi.role == 'alpha'
-  assert pi.name == 'beta'
-  assert pi.version == 1
+  assert len(tti.metadata) == 1
+  pi = iter(tti.metadata).next()
+  assert pi.key == 'alpha'
+  assert pi.value == '1'
 
 
 def test_task_instance_from_job():


Mime
View raw message