scheduler: add job's tags to the rpc job_list method

This change adds the job's tags to the jobs list to enable
search over tags.

Change-Id: Iccad928db0594ea14d4784dd164d1139a2599297
This commit is contained in:
Tristan Cacqueray
2019-01-29 05:14:48 +00:00
parent 0f8f24e7df
commit b936ce5dd1
3 changed files with 18 additions and 0 deletions

View File

@@ -74,6 +74,8 @@
- job:
name: project-post
tags:
- post
nodeset:
nodes:
- name: static

View File

@@ -683,6 +683,17 @@ class TestWeb(BaseTestWeb):
variants = [{'parent': 'base'}]
self.assertEqual(variants, job.get('variants'))
def test_jobs_list_tags(self):
resp = self.get_url("api/tenant/tenant-one/jobs").json()
post_job = None
for job in resp:
if job['name'] == 'project-post':
post_job = job
break
self.assertIsNotNone(post_job)
self.assertEqual(['post'], post_job.get('tags'))
def test_web_job_noop(self):
job = self.get_url("api/tenant/tenant-one/job/noop").json()
self.assertEqual("noop", job[0]["name"])