diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 283: tags support in the dispatcher (Rafael Martins)

Message ID 20120509020110.22018.90595.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson May 9, 2012, 2:01 a.m. UTC
Merge authors:
  Rafael Martins (rafaelmartins)
Related merge proposals:
  https://code.launchpad.net/~rafaelmartins/lava-dispatcher/lava-dispatcher/+merge/105108
  proposed by: Rafael Martins (rafaelmartins)
  review: Needs Fixing - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 283 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Wed 2012-05-09 13:59:35 +1200
message:
  tags support in the dispatcher (Rafael Martins)
modified:
  lava_dispatcher/actions/launch_control.py
  lava_dispatcher/job.py
  lava_dispatcher/test_data.py
  setup.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/actions/launch_control.py'
--- lava_dispatcher/actions/launch_control.py	2012-03-08 22:29:23 +0000
+++ lava_dispatcher/actions/launch_control.py	2012-05-08 18:05:52 +0000
@@ -159,7 +159,7 @@ 
         if not all_bundles:
             main_bundle = {
                      "test_runs": [],
-                     "format": "Dashboard Bundle Format 1.2"
+                     "format": "Dashboard Bundle Format 1.3"
                    }
         else:
             main_bundle = all_bundles.pop(0)

=== modified file 'lava_dispatcher/job.py'
--- lava_dispatcher/job.py	2012-03-15 23:16:06 +0000
+++ lava_dispatcher/job.py	2012-05-08 22:03:24 +0000
@@ -79,7 +79,13 @@ 
             'enum': ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"],
             'optional': True,
             },
-        },
+        'tags': {
+            'type': 'array',
+            'uniqueItems': True,
+            'items': {'type': 'string'},
+            'optional': True,
+            },
+        }, 
     }
 
 
@@ -110,6 +116,10 @@ 
         return self.job_data['target']
 
     @property
+    def tags(self):
+        return self.job_data.get('tags', [])
+
+    @property
     def logging_level(self):
         try:
             return self.job_data['logging_level']
@@ -133,6 +143,8 @@ 
         if 'device_type' in self.job_data:
             metadata['target.device_type'] = self.job_data['device_type']
         self.context.test_data.add_metadata(metadata)
+        
+        self.context.test_data.add_tags(self.tags)
 
         try:
             for cmd in self.job_data['actions']:

=== modified file 'lava_dispatcher/test_data.py'
--- lava_dispatcher/test_data.py	2011-11-11 14:47:22 +0000
+++ lava_dispatcher/test_data.py	2012-05-08 18:05:52 +0000
@@ -26,7 +26,7 @@ 
     def __init__(self, test_id='lava'):
         self.job_status = 'pass'
         self.metadata = {}
-        self._test_run = { 'test_results':[], 'attachments':[] }
+        self._test_run = { 'test_results':[], 'attachments':[], 'tags':[] }
         self._test_run['test_id'] = test_id
         self._assign_date()
         self._assign_uuid()
@@ -51,6 +51,13 @@ 
     def add_attachment(self, attachment):
         self._test_run['attachments'].append(attachment)
 
+    def add_tag(self, tag):
+        self._test_run['tags'].append(tag)
+
+    def add_tags(self, tags):
+        for tag in tags:
+            self.add_tag(tag)
+
     def add_metadata(self, metadata):
         self.metadata.update(metadata)
 

=== modified file 'setup.py'
--- setup.py	2012-03-22 18:22:14 +0000
+++ setup.py	2012-05-08 22:06:32 +0000
@@ -26,7 +26,7 @@ 
             ],
         },
     install_requires=[
-        "json-schema-validator",
+        "json-schema-validator >= 2.3",
         "lava-tool >= 0.4",
         "lava-utils-interface",
         "pexpect >= 2.3",