You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/06/22 19:25:19 UTC

[airflow] 41/47: Improve hints for reproducing tests (#16545)

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

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

commit 99334a95ae33ea4c3ed45adb75828fb6106dfa3f
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sun Jun 20 11:07:57 2021 +0200

    Improve hints for reproducing tests (#16545)
    
    The hints to reproducible run of test are improved:
    
    * colors added
    * they are much shorter and only most useful option is shown
    
    (cherry picked from commit 9e49693ea5ecdbe83f8f111e91e9633d6ba2ed3b)
---
 .../ci_run_single_airflow_test_in_docker.sh        | 43 ++++------------------
 1 file changed, 7 insertions(+), 36 deletions(-)

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 012493d..a73fc17 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
@@ -132,42 +132,13 @@ function run_airflow_testing_in_docker() {
         echo "${COLOR_RED}*        See the above log for details.${COLOR_RESET}"
         echo "${COLOR_RED}*${COLOR_RESET}"
         echo "${COLOR_RED}***********************************************************************************************${COLOR_RESET}"
-        echo """
-*  You can easily reproduce the failed tests on your dev machine/
-*
-*   When you have the source branch checked out locally:
-*
-*     Run all tests:
-*
-*       ./breeze --backend ${BACKEND} ${EXTRA_ARGS}--python ${PYTHON_MAJOR_MINOR_VERSION} --db-reset --skip-mounting-local-sources --test-type ${TEST_TYPE} tests
-*
-*     Enter docker shell:
-*
-*       ./breeze --backend ${BACKEND} ${EXTRA_ARGS}--python ${PYTHON_MAJOR_MINOR_VERSION} --db-reset --skip-mounting-local-sources --test-type ${TEST_TYPE} shell
-*"""
-    if [[ -n "${GITHUB_REGISTRY_PULL_IMAGE_TAG=}" ]]; then
-        echo """
-*   When you do not have sources:
-*
-*     Run all tests:
-*
-*      ./breeze --github-image-id ${GITHUB_REGISTRY_PULL_IMAGE_TAG} --backend ${BACKEND} ${EXTRA_ARGS}--python ${PYTHON_MAJOR_MINOR_VERSION} --db-reset --skip-mounting-local-sources --test-type ${TEST_TYPE} tests
-*
-*     Enter docker shell:
-*
-*      ./breeze --github-image-id ${GITHUB_REGISTRY_PULL_IMAGE_TAG} --backend ${BACKEND} ${EXTRA_ARGS}--python ${PYTHON_MAJOR_MINOR_VERSION} --db-reset --skip-mounting-local-sources --test-type ${TEST_TYPE} shell
-*"""
-    fi
-    echo """
-*
-*   NOTE! Once you are in the docker shell, you can run failed test with:
-*
-*            pytest [TEST_NAME]
-*
-*   You can copy the test name from the output above
-*
-***********************************************************************************************"""
-
+        echo
+        echo "${COLOR_BLUE}***********************************************************************************************${COLOR_RESET}"
+        echo "${COLOR_BLUE}Reproduce the failed tests on your local machine:${COLOR_RESET}"
+        echo "${COLOR_YELLOW}./breeze --github-image-id ${GITHUB_REGISTRY_PULL_IMAGE_TAG=} --backend ${BACKEND} ${EXTRA_ARGS}--python ${PYTHON_MAJOR_MINOR_VERSION} --db-reset --skip-mounting-local-sources --test-type ${TEST_TYPE} shell${COLOR_RESET}"
+        echo "${COLOR_BLUE}Then you can run failed tests with:${COLOR_RESET}"
+        echo "${COLOR_YELLOW}pytest [TEST_NAME]${COLOR_RESET}"
+        echo "${COLOR_BLUE}***********************************************************************************************${COLOR_RESET}"
     fi
 
     echo ${exit_code} > "${PARALLEL_JOB_STATUS}"