aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPuthikorn Voravootivat <puthik@google.com>2022-05-24 17:31:08 -0700
committerPuthikorn Voravootivat <puthik@chromium.org>2022-05-27 00:24:13 +0000
commit64420bb14c035718e37f6a585220d24084251f70 (patch)
tree195460e15644343b5f78a4412b73b9a2dcb5802d
parentd0706497d5283b961dca62cf37f8c50ad9812463 (diff)
downloadautotest-64420bb14c035718e37f6a585220d24084251f70.tar.gz
power_test: Add parallax reporting
Add parallax.html in results directory for power test. BUG=b:233932178 TEST=Ran PLT & videocall fdo fast and see output Change-Id: Ie1a866da9a6557dd77cde40b7cc21c92ff5488b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3669125 Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Tested-by: Puthikorn Voravootivat <puthik@chromium.org>
-rw-r--r--client/cros/power/power_dashboard.py30
-rw-r--r--client/cros/power/power_test.py1
-rwxr-xr-xclient/site_tests/power_LoadTest/power_LoadTest.py1
3 files changed, 32 insertions, 0 deletions
diff --git a/client/cros/power/power_dashboard.py b/client/cros/power/power_dashboard.py
index cdd00e7c3b..7e9ac9219c 100644
--- a/client/cros/power/power_dashboard.py
+++ b/client/cros/power/power_dashboard.py
@@ -789,3 +789,33 @@ class LoggerDashboardFactory(object):
uploadurl = 'http://chrome-power.appspot.com/rapl'
dashboard = self.loggerToDashboardDict[type(logger)]
return dashboard(logger, testname, resultsdir, uploadurl, note)
+
+
+def generate_parallax_report(output_dir):
+ """Generate parallax report in the result directory."""
+ parallax_url = 'http://crospower.page.link/parallax'
+ local_dir = '/usr/local'
+ parallax_tar = os.path.join(local_dir, 'parallax.tar.xz')
+ parallax_dir = os.path.join(local_dir, 'report_analysis')
+ parallax_exe = os.path.join(parallax_dir, 'process.py')
+ results_dir = os.path.join(output_dir, 'results')
+ parallax_html = os.path.join(results_dir, 'parallax.html')
+
+ # Download the source
+ cmd = ' '.join(['wget', parallax_url, '-O', parallax_tar])
+ utils.run(cmd)
+
+ # Extract the tool
+ cmd = ' '.join(['tar', 'xf', parallax_tar, '-C', local_dir])
+ utils.run(cmd)
+
+ # Run the tool
+ cmd = ' '.join([
+ 'python', parallax_exe, '-t', 'PowerQual', '-p', output_dir, '-o',
+ parallax_html
+ ])
+ utils.run(cmd)
+
+ # Clean up the tool
+ cmd = ' '.join(['rm', '-rf', parallax_tar, parallax_dir])
+ utils.run(cmd)
diff --git a/client/cros/power/power_test.py b/client/cros/power/power_test.py
index 727550946c..ef02452798 100644
--- a/client/cros/power/power_test.py
+++ b/client/cros/power/power_test.py
@@ -337,6 +337,7 @@ class power_Test(test.test):
super(power_Test, self).postprocess_iteration()
self.publish_dashboard()
self._save_results()
+ power_dashboard.generate_parallax_report(self.outputdir)
if self._failure_messages:
raise error.TestFail('Test has failed with messages: %s' %
self._failure_messages)
diff --git a/client/site_tests/power_LoadTest/power_LoadTest.py b/client/site_tests/power_LoadTest/power_LoadTest.py
index f01040d809..b1cc99e125 100755
--- a/client/site_tests/power_LoadTest/power_LoadTest.py
+++ b/client/site_tests/power_LoadTest/power_LoadTest.py
@@ -626,6 +626,7 @@ class power_LoadTest(arc.ArcTest):
self.tagged_testname, self.resultsdir, note=self._pdash_note)
dashboard.upload()
+ power_dashboard.generate_parallax_report(self.outputdir)
def cleanup(self):
force_discharge_utils.restore(self._force_discharge_success)