Merge "Assert on all atest runner commands in dry run integration tests" into main am: 4b5b69334f am: e27250e0b3

Original change: https://android-review.googlesource.com/c/platform/tools/asuite/+/3310177

Change-Id: I9c62e5a2f802e5a7737cc5e09254252c915e9bfc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/atest/integration_tests/atest_dry_run_diff_tests.py b/atest/integration_tests/atest_dry_run_diff_tests.py
index 5031b5c..3bab945 100644
--- a/atest/integration_tests/atest_dry_run_diff_tests.py
+++ b/atest/integration_tests/atest_dry_run_diff_tests.py
@@ -154,7 +154,7 @@
             map(
                 lambda result: result.get_atest_log_values_from_prefix(
                     atest_integration_test.DRY_RUN_COMMAND_LOG_PREFIX
-                )[0],
+                ),
                 cmd_results_prod,
             )
         ),
@@ -165,7 +165,7 @@
             map(
                 lambda result: result.get_atest_log_values_from_prefix(
                     atest_integration_test.DRY_RUN_COMMAND_LOG_PREFIX
-                )[0],
+                ),
                 cmd_results_dev,
             )
         ),
@@ -209,21 +209,29 @@
       with self.subTest(
           name=f'{usages[idx].command}_runner_cmd_has_same_elements'
       ):
-        sanitized_runner_cmd_prod = (
-            atest_integration_test.sanitize_runner_command(runner_cmd_prod[idx])
-        )
-        sanitized_runner_cmd_dev = (
-            atest_integration_test.sanitize_runner_command(runner_cmd_dev[idx])
-        )
         self.assertEqual(
-            set(sanitized_runner_cmd_prod.split(' ')),
-            set(sanitized_runner_cmd_dev.split(' ')),
-            'Runner command mismatch for command:'
-            f' {usages[idx].command}.\nProd:\n'
-            f' {sanitized_runner_cmd_prod}\nDev:\n{sanitized_runner_cmd_dev}\n'
-            f' {impact_str}',
+            len(runner_cmd_prod[idx]),
+            len(runner_cmd_dev[idx]),
+            'Nummber of runner commands mismatch for command:'
+            ' {usages[idx].command}.',
         )
 
+        for cmd_idx in range(len(runner_cmd_prod[idx])):
+          sanitized_runner_cmd_prod = (
+              atest_integration_test.sanitize_runner_command(runner_cmd_prod[idx][cmd_idx])
+          )
+          sanitized_runner_cmd_dev = (
+              atest_integration_test.sanitize_runner_command(runner_cmd_dev[idx][cmd_idx])
+          )
+          self.assertEqual(
+              set(sanitized_runner_cmd_prod.split(' ')),
+              set(sanitized_runner_cmd_dev.split(' ')),
+              'Runner command mismatch for command:'
+              f' {usages[idx].command}.\nProd:\n'
+              f' {sanitized_runner_cmd_prod}\nDev:\n{sanitized_runner_cmd_dev}\n'
+              f' {impact_str}',
+          )
+
 
 # A copy of the list of atest commands tested in the command verification tests.
 _default_input_commands = [