betty-arc-r to generate VM image

This is a pretty ugly hack to get around the problem
of not having VM tests while also needing VM build
image.

BUG=chromium:1092972
TEST=./run_pytest

Change-Id: I95b04f7a52a888378448a1c62c30e6404446561d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2246730
Commit-Queue: Dhanya Ganesh <dhanyaganesh@chromium.org>
Tested-by: Dhanya Ganesh <dhanyaganesh@chromium.org>
Reviewed-by: Sean Abraham <seanabraham@chromium.org>
diff --git a/cbuildbot/stages/build_stages.py b/cbuildbot/stages/build_stages.py
index aa74089..a8a8eec 100644
--- a/cbuildbot/stages/build_stages.py
+++ b/cbuildbot/stages/build_stages.py
@@ -813,8 +813,12 @@
     parallel.RunParallelSteps([self._BuildVMImage, self._BuildGceTarballs])
 
   def _BuildVMImage(self):
-    if ((self._run.config.vm_tests or self._run.config.tast_vm_tests) and
-        not self._afdo_generate_min):
+    # Adding startswith('betty') hack to create VM image for betty-arc-r.
+    # VM testing doesn't work on ARCVM but we still need the image.
+    # https://crbug.com/1092972.
+    if ((self._run.config.vm_tests or self._run.config.tast_vm_tests
+         or self._current_board.startswith('betty'))
+        and not self._afdo_generate_min):
       commands.BuildVMImageForTesting(
           self._build_root,
           self._current_board,
diff --git a/config/chromeos_test_config.py b/config/chromeos_test_config.py
index e5e6522..519a26b 100644
--- a/config/chromeos_test_config.py
+++ b/config/chromeos_test_config.py
@@ -20,6 +20,7 @@
     'amd64-generic', # Has kernel 4.4, used with public Chromium.
     'betty',         # amd64 Chrome OS VM board with 32 bit arm/x86 ARC++ ABI.
     'betty-pi-arc',  # Like betty but P version of ARC++.
+    'betty-arc-r',  # Like betty but R version of ARC++.
     'novato',        # Like betty but with GMSCore but not the Play Store
     'novato-arc64',  # 64 bit x86_64 ARC++ ABI
 ]) | config_boards.lakitu_boards  # All lakitu boards have VM support.
diff --git a/config/config_dump.json b/config/config_dump.json
index 9afbda3..c789e35 100644
--- a/config/config_dump.json
+++ b/config/config_dump.json
@@ -3561,8 +3561,7 @@
         "prebuilts": "public",
         "useflags": [
             "-chrome_internal"
-        ],
-        "vm_tests": []
+        ]
     },
     "betty-arc-r-full-tryjob": {
         "_template": "full",
@@ -3585,8 +3584,7 @@
         "prebuilts": "public",
         "useflags": [
             "-chrome_internal"
-        ],
-        "vm_tests": []
+        ]
     },
     "betty-arc-r-llvm-next-toolchain": {
         "_template": "llvm_next_toolchain",
@@ -3645,7 +3643,7 @@
         "hw_tests_override": [],
         "important": false,
         "vm_tests": [],
-        "vm_tests_override": null
+        "vm_tests_override": []
     },
     "betty-arc-r-release-tryjob": {
         "_template": "release",