Skip to content

Commit

Permalink
[FLINK-19450][python][tests] Optimize the Python CI Test to reduce ex…
Browse files Browse the repository at this point in the history
…ecution time

This closes apache#13520.
  • Loading branch information
HuangXingBo authored and dianfu committed Oct 19, 2020
1 parent 85668d3 commit a471efe
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions flink-python/dev/lint-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ function install_miniconda() {
# Install some kinds of py env.
function install_py_env() {
py_env=("3.5" "3.6" "3.7" "3.8")
if [[ ${BUILD_REASON} = 'IndividualCI' ]]; then
py_env=("3.8")
else
py_env=("3.5" "3.6" "3.7" "3.8")
fi
for ((i=0;i<${#py_env[@]};i++)) do
if [ -d "$CURRENT_DIR/.conda/envs/${py_env[i]}" ]; then
rm -rf "$CURRENT_DIR/.conda/envs/${py_env[i]}"
Expand Down Expand Up @@ -529,14 +533,20 @@ function check_stage() {
#########################
# Tox check
function tox_check() {
LATEST_PYTHON="py38"
print_function "STAGE" "tox checks"
# Set created py-env in $PATH for tox's creating virtual env
activate
# Ensure the permission of the scripts set correctly
chmod +x $FLINK_PYTHON_DIR/../build-target/bin/*
chmod +x $FLINK_PYTHON_DIR/dev/*

$TOX_PATH -c $FLINK_PYTHON_DIR/tox.ini --recreate 2>&1 | tee -a $LOG_FILE
if [[ ${BUILD_REASON} = 'IndividualCI' ]]; then
# Only run test in latest python version triggered by a Git push
$TOX_PATH -c $FLINK_PYTHON_DIR/tox.ini -e ${LATEST_PYTHON} --recreate 2>&1 | tee -a $LOG_FILE
else
$TOX_PATH -c $FLINK_PYTHON_DIR/tox.ini --recreate 2>&1 | tee -a $LOG_FILE
fi

TOX_RESULT=$((grep -c "congratulations :)" "$LOG_FILE") 2>&1)
if [ $TOX_RESULT -eq '0' ]; then
Expand Down

0 comments on commit a471efe

Please sign in to comment.