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 a0aa93f98c Fix too long names of files and docker compose projects 
(#25301)
a0aa93f98c is described below

commit a0aa93f98ca7cb2709c53acf9528eedf9eca2fbe
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Jul 26 17:31:26 2022 +0200

    Fix too long names of files and docker compose projects (#25301)
    
    When there is a change spanning multiple providers, the test type
    might be very long "Providers[google,microsoft.mssql......]".
    
    Test type is used in generating directory/file names as well as
    in determining docker compose project names and such long name might
    be just ... too long. But at any point in time we only run one
    Provider* test type, so we can simply truncate the "[*]" when we
    use TEST_TYPE to determine dir and docker-compose name.
    
    This PR does exactly this.
---
 Dockerfile.ci                                              | 4 ++--
 scripts/ci/testing/ci_run_airflow_testing.sh               | 6 +++---
 scripts/ci/testing/ci_run_single_airflow_test_in_docker.sh | 6 +++---
 scripts/docker/entrypoint_ci.sh                            | 4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Dockerfile.ci b/Dockerfile.ci
index d48eb9eaf1..c84c3804a3 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -740,7 +740,7 @@ if [[ "${RUN_TESTS}" != "true" ]]; then
 fi
 set -u
 
-export RESULT_LOG_FILE="/files/test_result-${TEST_TYPE}-${BACKEND}.xml"
+export RESULT_LOG_FILE="/files/test_result-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
 
 EXTRA_PYTEST_ARGS=(
     "--verbosity=0"
@@ -782,7 +782,7 @@ if [[ ${ENABLE_TEST_COVERAGE:="false"} == "true" ]]; then
     EXTRA_PYTEST_ARGS+=(
         "--cov=airflow/"
         "--cov-config=.coveragerc"
-        "--cov-report=xml:/files/coverage-${TEST_TYPE}-${BACKEND}.xml"
+        "--cov-report=xml:/files/coverage-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
     )
 fi
 
diff --git a/scripts/ci/testing/ci_run_airflow_testing.sh 
b/scripts/ci/testing/ci_run_airflow_testing.sh
index 5c0c10c3f3..fa5165b470 100755
--- a/scripts/ci/testing/ci_run_airflow_testing.sh
+++ b/scripts/ci/testing/ci_run_airflow_testing.sh
@@ -39,9 +39,9 @@ function run_test_types_in_parallel() {
     for TEST_TYPE in ${test_types_to_run}
     do
         export TEST_TYPE
-        mkdir -p "${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE}"
-        export 
JOB_LOG="${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE}/stdout"
-        export 
PARALLEL_JOB_STATUS="${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE}/status"
+        mkdir -p 
"${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE/\[*\]/}"
+        export 
JOB_LOG="${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE/\[*\]/}/stdout"
+        export 
PARALLEL_JOB_STATUS="${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE/\[*\]/}/status"
         # Each test job will get SIGTERM followed by SIGTERM 200ms later and 
SIGKILL 200ms later after 45 mins
         # shellcheck disable=SC2086
         parallel --ungroup --bg --semaphore --semaphorename 
"${SEMAPHORE_NAME}" \
diff --git a/scripts/ci/testing/ci_run_single_airflow_test_in_docker.sh 
b/scripts/ci/testing/ci_run_single_airflow_test_in_docker.sh
index bc5bc041ed..f1afd2687f 100755
--- a/scripts/ci/testing/ci_run_single_airflow_test_in_docker.sh
+++ b/scripts/ci/testing/ci_run_single_airflow_test_in_docker.sh
@@ -89,7 +89,7 @@ function run_airflow_testing_in_docker() {
     echo
     docker-compose -f "${SCRIPTS_CI_DIR}/docker-compose/base.yml" \
         "${INTEGRATIONS[@]}" \
-        --project-name "airflow-${TEST_TYPE,,}-${BACKEND}" \
+        --project-name "airflow-${TEST_TYPE/\[*\]/}-${BACKEND}" \
         down --remove-orphans \
         --volumes --timeout 10
     docker-compose --log-level INFO \
@@ -97,7 +97,7 @@ function run_airflow_testing_in_docker() {
       "${BACKEND_DOCKER_COMPOSE[@]}" \
       "${INTEGRATIONS[@]}" \
       "${DOCKER_COMPOSE_LOCAL[@]}" \
-      --project-name "airflow-${TEST_TYPE,,}-${BACKEND}" \
+      --project-name "airflow-${TEST_TYPE/\[*\]/}-${BACKEND}" \
          run airflow "${@}"
     exit_code=$?
     docker ps
@@ -112,7 +112,7 @@ function run_airflow_testing_in_docker() {
 
     docker-compose --log-level INFO -f 
"${SCRIPTS_CI_DIR}/docker-compose/base.yml" \
         "${INTEGRATIONS[@]}" \
-        --project-name "airflow-${TEST_TYPE,,}-${BACKEND}" \
+        --project-name "airflow-${TEST_TYPE/\[*\]/}-${BACKEND}" \
         down --remove-orphans \
         --volumes --timeout 10
     set -u
diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh
index ef6d092779..175c3ad8fd 100755
--- a/scripts/docker/entrypoint_ci.sh
+++ b/scripts/docker/entrypoint_ci.sh
@@ -244,7 +244,7 @@ if [[ "${RUN_TESTS}" != "true" ]]; then
 fi
 set -u
 
-export RESULT_LOG_FILE="/files/test_result-${TEST_TYPE}-${BACKEND}.xml"
+export RESULT_LOG_FILE="/files/test_result-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
 
 EXTRA_PYTEST_ARGS=(
     "--verbosity=0"
@@ -286,7 +286,7 @@ if [[ ${ENABLE_TEST_COVERAGE:="false"} == "true" ]]; then
     EXTRA_PYTEST_ARGS+=(
         "--cov=airflow/"
         "--cov-config=.coveragerc"
-        "--cov-report=xml:/files/coverage-${TEST_TYPE}-${BACKEND}.xml"
+        "--cov-report=xml:/files/coverage-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
     )
 fi
 

Reply via email to