Merge lp:~pwlars/lava-test/dashboard-format-1.2 into lp:lava-test/0.0

Proposed by Paul Larson
Status: Merged
Merged at revision: 63
Proposed branch: lp:~pwlars/lava-test/dashboard-format-1.2
Merge into: lp:lava-test/0.0
Diff against target: 197 lines (+34/-34)
6 files modified
abrek/hwprofile.py (+4/-4)
abrek/swprofile.py (+11/-11)
abrek/testdef.py (+5/-5)
tests/test_dashboard.py (+8/-8)
tests/test_hwprofile.py (+1/-1)
tests/test_swprofile.py (+5/-5)
To merge this branch: bzr merge lp:~pwlars/lava-test/dashboard-format-1.2
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+56692@code.launchpad.net

Description of the change

Dashboard Format 1.2 for abrek

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Looks good, thanks for doing this!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'abrek/hwprofile.py'
2--- abrek/hwprofile.py 2011-03-23 19:28:04 +0000
3+++ abrek/hwprofile.py 2011-04-07 05:29:14 +0000
4@@ -197,16 +197,16 @@
5 devices.append(device)
6 return devices
7
8-def get_hw_context():
9+def get_hardware_context():
10 """
11 Return a dict with all of the hardware profile information gathered
12 """
13- hw_context = {}
14+ hardware_context = {}
15 devices = []
16 devices.extend(get_cpu_devs())
17 devices.extend(get_board_devs())
18 devices.extend(get_mem_devs())
19 devices.extend(get_usb_devs())
20- hw_context['devices'] = devices
21- return hw_context
22+ hardware_context['devices'] = devices
23+ return hardware_context
24
25
26=== modified file 'abrek/swprofile.py'
27--- abrek/swprofile.py 2010-11-19 18:45:35 +0000
28+++ abrek/swprofile.py 2011-04-07 05:29:14 +0000
29@@ -35,8 +35,8 @@
30 packages.append(pkg)
31 return packages
32
33-def get_sw_context(apt_cache=None, lsb_information=None):
34- """ Return dict used for storing sw_context information
35+def get_software_context(apt_cache=None, lsb_information=None):
36+ """ Return dict used for storing software_context information
37
38 test_id - Unique identifier for this test
39 time_check - whether or not a check was performed to see if
40@@ -44,22 +44,22 @@
41 apt_cache - if not provided, this will be read from the system
42 lsb_information - if not provided, this will be read from the system
43 """
44- sw_context = {}
45- sw_context['sw_image'] = get_sw_image(lsb_information)
46- sw_context['packages'] = get_packages(apt_cache)
47- return sw_context
48+ software_context = {}
49+ software_context['image'] = get_image(lsb_information)
50+ software_context['packages'] = get_packages(apt_cache)
51+ return software_context
52
53-def get_sw_image(lsb_information=None):
54+def get_image(lsb_information=None):
55 """ Get information about the image we are running
56
57- If /etc/buildstamp exists, get the sw_image id from that. Otherwise
58+ If /etc/buildstamp exists, get the image id from that. Otherwise
59 just use the lsb-release description for a rough idea.
60 """
61 try:
62 buildstamp = read_file("/etc/buildstamp")
63- desc = buildstamp.splitlines()[1]
64+ name = buildstamp.splitlines()[1]
65 except IOError:
66 if lsb_information == None:
67 lsb_information = lsb_release.get_lsb_information()
68- desc = lsb_information['DESCRIPTION']
69- return {"desc":desc}
70+ name = lsb_information['DESCRIPTION']
71+ return {"name":name}
72
73=== modified file 'abrek/testdef.py'
74--- abrek/testdef.py 2011-04-01 18:43:44 +0000
75+++ abrek/testdef.py 2011-04-07 05:29:14 +0000
76@@ -96,17 +96,17 @@
77 TIMEFORMAT = '%Y-%m-%dT%H:%M:%SZ'
78 testdata = {}
79 test_runs = [{}]
80- testdata['format'] = "Dashboard Bundle Format 1.0"
81+ testdata['format'] = "Dashboard Bundle Format 1.2"
82 filename = os.path.join(self.resultsdir, 'testdata.json')
83 test_runs[0]['test_id'] = self.testname
84 test_runs[0]['analyzer_assigned_uuid'] = str(uuid1())
85 test_runs[0]['time_check_performed'] = False
86 test_runs[0]['analyzer_assigned_date'] = datetime.strftime(
87 self.runner.starttime,TIMEFORMAT)
88- hw = hwprofile.get_hw_context()
89- test_runs[0]['hw_context'] = hw
90- sw = swprofile.get_sw_context()
91- test_runs[0]['sw_context'] = sw
92+ hw = hwprofile.get_hardware_context()
93+ test_runs[0]['hardware_context'] = hw
94+ sw = swprofile.get_software_context()
95+ test_runs[0]['software_context'] = sw
96 testdata['test_runs'] = test_runs
97 write_file(json.dumps(testdata, indent=2), filename)
98
99
100=== modified file 'tests/test_dashboard.py'
101--- tests/test_dashboard.py 2010-10-12 00:24:57 +0000
102+++ tests/test_dashboard.py 2011-04-07 05:29:14 +0000
103@@ -79,29 +79,29 @@
104 "test_runs": [{
105 "analyzer_assigned_date": "2010-10-10T00:00:00Z",
106 "analyzer_assigned_uuid": testuuid,
107- "hw_context": {},
108- "sw_context": {},
109+ "hardware_context": {},
110+ "software_context": {},
111 "test_id": "stream",
112 "test_results": [{
113- "measurement": "1111.1111",
114+ "measurement": 1111.1111,
115 "result": "pass",
116 "test_case_id": "Copy",
117 "units": "MB/s"
118 },
119 {
120- "measurement": "2222.2222",
121+ "measurement": 2222.2222,
122 "result": "pass",
123 "test_case_id": "Scale",
124 "units": "MB/s"
125 },
126 {
127- "measurement": "3333.3333",
128+ "measurement": 3333.3333,
129 "result": "pass",
130 "test_case_id": "Add",
131 "units": "MB/s"
132 },
133 {
134- "measurement": "4444.4444",
135+ "measurement": 4444.4444,
136 "result": "pass",
137 "test_case_id": "Triad",
138 "units": "MB/s"
139@@ -162,8 +162,8 @@
140 {"test_runs": [{
141 "analyzer_assigned_date": "2010-10-10T00:00:00Z",
142 "analyzer_assigned_uuid": "%s",
143- "hw_context": {},
144- "sw_context": {},
145+ "hardware_context": {},
146+ "software_context": {},
147 "test_id": "stream",
148 "time_check_performed": false
149 }]
150
151=== modified file 'tests/test_hwprofile.py'
152--- tests/test_hwprofile.py 2010-11-19 18:37:53 +0000
153+++ tests/test_hwprofile.py 2011-04-07 05:29:14 +0000
154@@ -133,7 +133,7 @@
155 meminfo = {
156 'attributes': {
157 'kind': 'RAM',
158- 'capacity': 243937280},
159+ 'capacity': '243937280'},
160 'description': '232MiB of RAM',
161 'device_type': 'device.mem'}
162 self.assertEqual(meminfo, devs[0])
163
164=== modified file 'tests/test_swprofile.py'
165--- tests/test_swprofile.py 2010-11-24 16:34:45 +0000
166+++ tests/test_swprofile.py 2011-04-07 05:29:14 +0000
167@@ -49,7 +49,7 @@
168 cache = self.cache
169 if info == None:
170 info = self.lsb_information
171- return abrek.swprofile.get_sw_context(apt_cache=cache,
172+ return abrek.swprofile.get_software_context(apt_cache=cache,
173 lsb_information=info)
174
175 def test_pkg_name(self):
176@@ -62,18 +62,18 @@
177 for pkg in a['packages']:
178 self.assertEqual(self.testpackage.installed.version, pkg['version'])
179
180- def test_sw_image_desc_lsb(self):
181+ def test_image_name_lsb(self):
182 a = self.make_profile()
183 if os.path.exists('/etc/buildstamp'):
184 return
185- self.assertEqual(self.lsb_desc, a['sw_image']['desc'])
186+ self.assertEqual(self.lsb_desc, a['image']['name'])
187
188- def test_sw_image_desc_buildstamp(self):
189+ def test_image_name_buildstamp(self):
190 BUILDSTAMP = "linaro-m-headless-20101101-0"
191 BUILDSTAMPFILE = "lexbuild6 Mon, 01 Nov 2010 02:11:39 -0400\n%s" % (
192 BUILDSTAMP)
193 fake_file('/etc/buildstamp', BUILDSTAMPFILE)
194 a = self.make_profile()
195 clear_fakes()
196- self.assertEqual(BUILDSTAMP, a['sw_image']['desc'])
197+ self.assertEqual(BUILDSTAMP, a['image']['name'])
198

Subscribers

People subscribed via source and target branches