Bowrna commented on code in PR #23715:
URL: https://github.com/apache/airflow/pull/23715#discussion_r974074300
##########
dev/breeze/src/airflow_breeze/commands/testing_commands.py:
##########
@@ -187,6 +192,62 @@ def run_with_progress(
return result
+def run_tests(
+ env_variables: Dict[str, str], dry_run: bool, verbose: bool, test_type:
str, extra_pytest_args: Tuple
+) -> Tuple[int, str]:
+ env_variables['TEST_TYPE'] = test_type
+ perform_environment_checks(verbose=verbose)
+ cmd = ['docker-compose', 'run', '--service-ports', '--rm', 'airflow']
+ cmd.extend(list(extra_pytest_args))
+ test_result = run_command(
+ cmd,
+ verbose=verbose,
+ dry_run=dry_run,
+ env=env_variables,
+ )
+ return (
+ test_result.returncode,
+ f"Running tests {test_type}",
+ )
+
+
+def run_tests_in_parallel(
+ env_variables: Dict[str, str],
+ test_type_list: List[str],
+ include_success_outputs: bool,
+ skip_cleanup: bool,
+ parallelism: int,
+ dry_run: bool,
+ verbose: bool,
+ extra_pytest_args: Tuple,
+):
+ """Run tests in parallel"""
+ with ci_group(f"Running tests for the type {test_type_list}"):
+ # get_console().print(
+ # f"\n[info]Running tests with parallelism = {parallelism} "
+ # f"for the test type: {test_type_list}[/]"
+ # )
+ all_params = [f"Tests {test_type}" for test_type in test_type_list]
+ with run_with_pool(
+ parallelism=parallelism,
+ all_params=all_params,
+ ) as (pool, outputs):
+ results = [
+ pool.apply_async(
+ run_tests,
+ args=(env_variables, dry_run, verbose, test_type,
extra_pytest_args),
Review Comment:
Let me check the other changes you made @potiuk
--
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]