Skip to content

Commit a0aa93f

Browse files
authored
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.
1 parent 3b9d7d2 commit a0aa93f

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

Dockerfile.ci

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ if [[ "${RUN_TESTS}" != "true" ]]; then
740740
fi
741741
set -u
742742

743-
export RESULT_LOG_FILE="/files/test_result-${TEST_TYPE}-${BACKEND}.xml"
743+
export RESULT_LOG_FILE="/files/test_result-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
744744

745745
EXTRA_PYTEST_ARGS=(
746746
"--verbosity=0"
@@ -782,7 +782,7 @@ if [[ ${ENABLE_TEST_COVERAGE:="false"} == "true" ]]; then
782782
EXTRA_PYTEST_ARGS+=(
783783
"--cov=airflow/"
784784
"--cov-config=.coveragerc"
785-
"--cov-report=xml:/files/coverage-${TEST_TYPE}-${BACKEND}.xml"
785+
"--cov-report=xml:/files/coverage-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
786786
)
787787
fi
788788

scripts/ci/testing/ci_run_airflow_testing.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ function run_test_types_in_parallel() {
3939
for TEST_TYPE in ${test_types_to_run}
4040
do
4141
export TEST_TYPE
42-
mkdir -p "${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE}"
43-
export JOB_LOG="${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE}/stdout"
44-
export PARALLEL_JOB_STATUS="${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE}/status"
42+
mkdir -p "${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE/\[*\]/}"
43+
export JOB_LOG="${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE/\[*\]/}/stdout"
44+
export PARALLEL_JOB_STATUS="${PARALLEL_MONITORED_DIR}/${SEMAPHORE_NAME}/${TEST_TYPE/\[*\]/}/status"
4545
# Each test job will get SIGTERM followed by SIGTERM 200ms later and SIGKILL 200ms later after 45 mins
4646
# shellcheck disable=SC2086
4747
parallel --ungroup --bg --semaphore --semaphorename "${SEMAPHORE_NAME}" \

scripts/ci/testing/ci_run_single_airflow_test_in_docker.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ function run_airflow_testing_in_docker() {
8989
echo
9090
docker-compose -f "${SCRIPTS_CI_DIR}/docker-compose/base.yml" \
9191
"${INTEGRATIONS[@]}" \
92-
--project-name "airflow-${TEST_TYPE,,}-${BACKEND}" \
92+
--project-name "airflow-${TEST_TYPE/\[*\]/}-${BACKEND}" \
9393
down --remove-orphans \
9494
--volumes --timeout 10
9595
docker-compose --log-level INFO \
9696
-f "${SCRIPTS_CI_DIR}/docker-compose/base.yml" \
9797
"${BACKEND_DOCKER_COMPOSE[@]}" \
9898
"${INTEGRATIONS[@]}" \
9999
"${DOCKER_COMPOSE_LOCAL[@]}" \
100-
--project-name "airflow-${TEST_TYPE,,}-${BACKEND}" \
100+
--project-name "airflow-${TEST_TYPE/\[*\]/}-${BACKEND}" \
101101
run airflow "${@}"
102102
exit_code=$?
103103
docker ps
@@ -112,7 +112,7 @@ function run_airflow_testing_in_docker() {
112112

113113
docker-compose --log-level INFO -f "${SCRIPTS_CI_DIR}/docker-compose/base.yml" \
114114
"${INTEGRATIONS[@]}" \
115-
--project-name "airflow-${TEST_TYPE,,}-${BACKEND}" \
115+
--project-name "airflow-${TEST_TYPE/\[*\]/}-${BACKEND}" \
116116
down --remove-orphans \
117117
--volumes --timeout 10
118118
set -u

scripts/docker/entrypoint_ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ if [[ "${RUN_TESTS}" != "true" ]]; then
244244
fi
245245
set -u
246246

247-
export RESULT_LOG_FILE="/files/test_result-${TEST_TYPE}-${BACKEND}.xml"
247+
export RESULT_LOG_FILE="/files/test_result-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
248248

249249
EXTRA_PYTEST_ARGS=(
250250
"--verbosity=0"
@@ -286,7 +286,7 @@ if [[ ${ENABLE_TEST_COVERAGE:="false"} == "true" ]]; then
286286
EXTRA_PYTEST_ARGS+=(
287287
"--cov=airflow/"
288288
"--cov-config=.coveragerc"
289-
"--cov-report=xml:/files/coverage-${TEST_TYPE}-${BACKEND}.xml"
289+
"--cov-report=xml:/files/coverage-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
290290
)
291291
fi
292292

0 commit comments

Comments
 (0)