This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new b702a9cd055 Auto install pnpm for UI e2e tests in breeze command 
(#58845)
b702a9cd055 is described below

commit b702a9cd055553e54fea7f1c6cfa6a0082037d1c
Author: Rahul Vats <[email protected]>
AuthorDate: Mon Dec 1 06:49:04 2025 +0530

    Auto install pnpm for UI e2e tests in breeze command (#58845)
    
    * Revert "Fix memory leak in remote logging connection cache (#56695)"
    
    This reverts commit 416c73e864b5c9a52b50053baa7876bcb5bcfe38.
    
    * enable e2e ui test to install pnpm if not installed
---
 .../airflow_breeze/commands/testing_commands.py    |  4 ++-
 dev/breeze/src/airflow_breeze/utils/run_utils.py   | 36 ++++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/dev/breeze/src/airflow_breeze/commands/testing_commands.py 
b/dev/breeze/src/airflow_breeze/commands/testing_commands.py
index 60d18417b8c..0dce9cf466a 100644
--- a/dev/breeze/src/airflow_breeze/commands/testing_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/testing_commands.py
@@ -1470,11 +1470,13 @@ def ui_e2e_tests(
     from pathlib import Path
 
     from airflow_breeze.utils.console import get_console
-    from airflow_breeze.utils.run_utils import run_command
+    from airflow_breeze.utils.run_utils import check_pnpm_installed, 
run_command
     from airflow_breeze.utils.shared_options import get_dry_run, get_verbose
 
     perform_environment_checks()
 
+    check_pnpm_installed()
+
     airflow_root = Path(__file__).resolve().parents[5]
     ui_dir = airflow_root / "airflow-core" / "src" / "airflow" / "ui"
 
diff --git a/dev/breeze/src/airflow_breeze/utils/run_utils.py 
b/dev/breeze/src/airflow_breeze/utils/run_utils.py
index 8c34f1e8a16..7a5374f3466 100644
--- a/dev/breeze/src/airflow_breeze/utils/run_utils.py
+++ b/dev/breeze/src/airflow_breeze/utils/run_utils.py
@@ -260,6 +260,42 @@ def assert_prek_installed():
         sys.exit(1)
 
 
+def check_pnpm_installed():
+    """
+    Check if pnpm is installed and install it if npm is available.
+    """
+    if shutil.which("pnpm"):
+        return
+
+    get_console().print("[warning]pnpm is not installed. Installing 
pnpm...[/]")
+
+    # Check if npm is available (required to install pnpm)
+    if not shutil.which("npm"):
+        get_console().print("[error]npm is not installed. Please install 
Node.js and npm first.[/]")
+        get_console().print("[warning]Visit: https://nodejs.org/[/]";)
+        sys.exit(1)
+
+    try:
+        get_console().print("[info]Installing pnpm using npm...[/]")
+        result = run_command(
+            ["npm", "install", "-g", "pnpm"],
+            no_output_dump_on_exception=True,
+            capture_output=True,
+            text=True,
+            check=False,
+        )
+        if result.returncode == 0:
+            get_console().print("[success]pnpm has been installed 
successfully![/]")
+        else:
+            get_console().print(f"[error]Failed to install pnpm: 
{result.stderr}[/]")
+            get_console().print("[warning]Please install pnpm manually: 
https://pnpm.io/installation[/]";)
+            sys.exit(1)
+    except Exception as e:
+        get_console().print(f"[error]Failed to install pnpm: {e}[/]")
+        get_console().print("[warning]Please install pnpm manually: 
https://pnpm.io/installation[/]";)
+        sys.exit(1)
+
+
 def get_filesystem_type(filepath: str):
     """
     Determine the type of filesystem used - we might want to use different 
parameters if tmpfs is used.

Reply via email to