potiuk commented on code in PR #48696:
URL: https://github.com/apache/airflow/pull/48696#discussion_r2026650081


##########
dev/breeze/src/airflow_breeze/utils/selective_checks.py:
##########
@@ -930,19 +966,32 @@ def providers_test_types_list_as_string(self) -> str | 
None:
                     test_types_to_remove.add(test_type)
             current_test_types = current_test_types - test_types_to_remove
         self._extract_long_provider_tests(current_test_types)
-        return " ".join(sorted(current_test_types))
+        return json.dumps(_get_test_list_as_json([sorted(current_test_types)]))
 
-    @cached_property
-    def individual_providers_test_types_list_as_string(self) -> str | None:
-        if not self.run_tests:
-            return None
+    def _get_individual_providers_list(self):
         current_test_types = 
set(self._get_providers_test_types_to_run(split_to_individual_providers=True))
         if "Providers" in current_test_types:
             current_test_types.remove("Providers")
             current_test_types.update(
                 {f"Providers[{provider}]" for provider in 
get_available_distributions(include_not_ready=True)}
             )
-        return " ".join(sorted(current_test_types))
+        return current_test_types
+
+    @cached_property
+    def individual_providers_test_types_list_as_strings_in_json(self) -> str | 
None:
+        """Splits the list of test types into several lists of strings (to run 
them in parallel)."""
+        if not self.run_tests:
+            return None
+        current_test_types = sorted(self._get_individual_providers_list())
+        if not current_test_types:
+            return None
+        # We are hard-coding the number of lists as reasonable starting point 
to split the
+        # list of test types - and we can modify it in the future
+        # TODO: In Python 3.12 we will be able to use itertools.batched
+        if len(current_test_types) < 5:

Review Comment:
   I will do it in a follow-up.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to