platform.CrosRuntimeProbe: skip tests when a category is waived
If we waive some categories, there will not exist such labels in the
host info labels. Therefore, it should be passed in this case. This CL
makes tast tests skip the probe action and pass tests directly.
For tests with multiple categories, i.e. input_device and network, the
probe action will be executed as before.
BUG=b:192028575,b:189719027
TEST=run all tests on FLEEX
Change-Id: Id70e8b3a9f8ad41342bd4f7ef5a1dffc02914eb0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tast-tests/+/2991865
Reviewed-by: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Clark Chung <ckclark@chromium.org>
Tested-by: Yun-Kai Lin <kevinptt@chromium.org>
Commit-Queue: Yun-Kai Lin <kevinptt@chromium.org>
(cherry picked from commit f12467696074152577a70ae65f0a05b60979326d)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/tast-tests/+/3026096
Reviewed-by: Yun-Kai Lin <kevinptt@chromium.org>
Auto-Submit: Yun-Kai Lin <kevinptt@chromium.org>
Commit-Queue: Clark Chung <ckclark@chromium.org>
diff --git a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_battery.go b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_battery.go
index c63bd17..01f37cf 100644
--- a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_battery.go
+++ b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_battery.go
@@ -40,9 +40,12 @@
if err != nil {
s.Fatal("Unable to decode autotest_host_info_labels: ", err)
}
-
+ // Waived components are defined in |waived_comp_categories| on the HWID
+ // service:
+ // platform/factory-private/config/hwid/service/appengine/configurations.yaml
if len(labels) == 0 {
- s.Fatal("No battery labels")
+ s.Log("No battery labels or known components. Skipped")
+ return
}
request := &rppb.ProbeRequest{
diff --git a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_camera.go b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_camera.go
index 6488228..dc2c7a2 100644
--- a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_camera.go
+++ b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_camera.go
@@ -46,9 +46,12 @@
s.Fatal("Unable to decode autotest_host_info_labels: ", err)
}
labels := mapping[category]
-
+ // Waived components are defined in |waived_comp_categories| on the HWID
+ // service:
+ // platform/factory-private/config/hwid/service/appengine/configurations.yaml
if len(labels) == 0 {
- s.Fatal("No camera labels")
+ s.Log("No camera labels or known components. Skipped")
+ return
}
request := &rppb.ProbeRequest{
diff --git a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_edid.go b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_edid.go
index 7c8061d..8981052 100644
--- a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_edid.go
+++ b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_edid.go
@@ -41,8 +41,12 @@
s.Fatal("Unable to decode autotest_host_info_labels: ", err)
}
labels := mapping[category]
+ // Waived components are defined in |waived_comp_categories| on the HWID
+ // service:
+ // platform/factory-private/config/hwid/service/appengine/configurations.yaml
if len(labels) == 0 {
- s.Fatal("No edid labels")
+ s.Log("No edid labels or known components. Skipped")
+ return
}
request := &rppb.ProbeRequest{
diff --git a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_memory.go b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_memory.go
index 0b4875e..bf66c0f 100644
--- a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_memory.go
+++ b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_memory.go
@@ -40,8 +40,13 @@
labels := mapping[category]
if err != nil {
s.Fatal("Unable to decode autotest_host_info_labels: ", err)
- } else if len(labels) == 0 {
- s.Fatal("No memory labels")
+ }
+ // Waived components are defined in |waived_comp_categories| on the HWID
+ // service:
+ // platform/factory-private/config/hwid/service/appengine/configurations.yaml
+ if len(labels) == 0 {
+ s.Log("No memory labels or known components. Skipped")
+ return
}
request := &rppb.ProbeRequest{
diff --git a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_storage.go b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_storage.go
index 452ef22..ceda3cd 100644
--- a/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_storage.go
+++ b/src/chromiumos/tast/local/bundles/cros/platform/cros_runtime_probe_storage.go
@@ -40,9 +40,12 @@
if err != nil {
s.Fatal("Unable to decode autotest_host_info_labels: ", err)
}
-
+ // Waived components are defined in |waived_comp_categories| on the HWID
+ // service:
+ // platform/factory-private/config/hwid/service/appengine/configurations.yaml
if len(labels) == 0 {
- s.Fatal("No storage labels")
+ s.Log("No storage labels or known components. Skipped")
+ return
}
request := &rppb.ProbeRequest{