crosperf: fix compress dir for tast tests
Tast results directory has different name from test_that results,
causing a bug when compress_results option is on. This CL fixes it.
BUG=chromium:1079048
TEST=Tested with tast and test_that benchmarks in crosperf
Change-Id: I06e6615c748aeeb2fc4576f4e1bcfdad93526962
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2218541
Reviewed-by: George Burgess <gbiv@chromium.org>
Commit-Queue: Zhizhou Yang <zhizhouy@google.com>
Tested-by: Zhizhou Yang <zhizhouy@google.com>
diff --git a/crosperf/results_cache.py b/crosperf/results_cache.py
index 08a5d1b..0dd60ea 100644
--- a/crosperf/results_cache.py
+++ b/crosperf/results_cache.py
@@ -118,7 +118,12 @@
def CompressResultsTo(self, dest_dir):
tarball = os.path.join(self.results_dir, RESULTS_TARBALL)
- results_dir = self.FindFilesInResultsDir('-name results').split('\n')[0]
+ # Test_that runs hold all output under TEST_NAME_HASHTAG/results/,
+ # while tast runs hold output under TEST_NAME/.
+ # Both ensure to be unique.
+ result_dir_name = self.test_name if self.suite == 'tast' else 'results'
+ results_dir = self.FindFilesInResultsDir(
+ '-name %s' % result_dir_name).split('\n')[0]
self.CreateTarball(results_dir, tarball)
self.CopyFilesTo(dest_dir, [tarball])
if results_dir: