You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2023/03/08 14:44:23 UTC

[airflow] 08/20: Fix `project-name` generation for Providers `test-type` in Breeze (#29030)

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

ephraimanierobi pushed a commit to branch v2-5-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit fbada0425747035b43d34210945ca092c8093452
Author: Josh Fell <48...@users.noreply.github.com>
AuthorDate: Thu Jan 19 06:37:21 2023 -0500

    Fix `project-name` generation for Providers `test-type` in Breeze (#29030)
    
    The `breeze testing tests --test-type "Providers[...]"` command would fail for an invalid `project-name` for `docker compose` if the provider(s) specified required a dotted path (e.g. `microsoft.azure`, `dbt.cloud`, etc.).
    
    This fixes the `project-name` generation in Breeze when using the `Providers` test type for those dotted-path providers.
    
    (cherry picked from commit be31214dcf14db39b7a5f422ca272cdc13e08268)
---
 dev/breeze/src/airflow_breeze/commands/testing_commands.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dev/breeze/src/airflow_breeze/commands/testing_commands.py b/dev/breeze/src/airflow_breeze/commands/testing_commands.py
index 74c3069417..86561cac58 100644
--- a/dev/breeze/src/airflow_breeze/commands/testing_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/testing_commands.py
@@ -17,6 +17,7 @@
 from __future__ import annotations
 
 import os
+import re
 import sys
 from datetime import datetime
 
@@ -199,8 +200,9 @@ def _run_test(
     return result.returncode, f"Test: {exec_shell_params.test_type}"
 
 
-def _file_name_from_test_type(test_type):
-    return test_type.lower().replace("[", "_").replace("]", "").replace(",", "_")[:30]
+def _file_name_from_test_type(test_type: str):
+    test_type_no_brackets = test_type.lower().replace("[", "_").replace("]", "")
+    return re.sub("[,\.]", "_", test_type_no_brackets)[:30]
 
 
 def _run_tests_in_pool(