Fix rdb settings and exe_rel_path compatibility for older branches

Older branches running legacy autotest wrapped tests still need some
inference from infra regarding rdb settings and exe_rel_path.

LED on M140: https://ci.chromium.org/b/8700962845042309761

Led-Recipes-Tester-Builder: luci.chromium.try:chromeos-octopus-rel
Bug: 450596053
Change-Id: Ia1f8b669eaa34c03cee91c66f4b10c4a4fc2e823
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/build/+/7043449
Commit-Queue: Qijiang Fan <fqj@chromium.org>
Reviewed-by: Struan Shrimpton <sshrimp@google.com>
Auto-Submit: Qijiang Fan <fqj@chromium.org>
diff --git a/recipes/recipe_modules/skylab/api.py b/recipes/recipe_modules/skylab/api.py
index da9cbc8..563d459 100644
--- a/recipes/recipe_modules/skylab/api.py
+++ b/recipes/recipe_modules/skylab/api.py
@@ -253,6 +253,10 @@
 
         if test.exe_rel_path:
           test_args.append(('exe_rel_path', test.exe_rel_path))
+        elif 'tast' in test.spec.autotest_name:
+          # TODO(b/450596053): Remove after M140 is no longer built.
+          test_args.append(
+              ('exe_rel_path', os.path.join(test.build_output_dir, 'chrome')))
 
         if test.tast_expr_file:
           test_args.append(('tast_expr_file', test.tast_expr_file))
@@ -429,10 +433,11 @@
     result_format = test.spec.resultdb.result_format
     # TODO(b/430180607): branched builder configuration does not have
     # result_format in spec, infer from test name. Remove later.
+    # Remove once all M142 and older milestone are gone.
     if not result_format:  # pragma: nocover
-      if test.spec.autotest_name:
+      if test.spec.autotest_name and 'tast' not in test.spec.autotest_name:
         # GPU test does not have branched builders. Wrapped test must be gtest
-        # for recent milestones.
+        # for recent milestones, except when tast is in test name.
         result_format = 'gtest'
       else:
         result_format = 'tast'