Skip to content

Commit

Permalink
[FLINK-34202][python] Optimize Python nightly CI time
Browse files Browse the repository at this point in the history
  • Loading branch information
HuangXingBo committed Feb 18, 2024
1 parent 050503c commit 3a04868
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion flink-python/dev/lint-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,16 @@ function tox_check() {
# Only run test in latest python version triggered by a Git push
$TOX_PATH -vv -c $FLINK_PYTHON_DIR/tox.ini -e ${LATEST_PYTHON} --recreate 2>&1 | tee -a $LOG_FILE
else
$TOX_PATH -vv -c $FLINK_PYTHON_DIR/tox.ini --recreate 2>&1 | tee -a $LOG_FILE
# Only run random selected python version in nightly CI.
ENV_LIST_STRING=`$TOX_PATH -l -c $FLINK_PYTHON_DIR/tox.ini`
_OLD_IFS=$IFS
IFS=$'\n'
ENV_LIST=(${ENV_LIST_STRING})
IFS=$_OLD_IFS

ENV_LIST_SIZE=${#ENV_LIST[@]}
index=$(($RANDOM % ENV_LIST_SIZE))
$TOX_PATH -vv -c $FLINK_PYTHON_DIR/tox.ini -e ${ENV_LIST[$index]} --recreate 2>&1 | tee -a $LOG_FILE
fi

TOX_RESULT=$((grep -c "congratulations :)" "$LOG_FILE") 2>&1)
Expand Down

0 comments on commit 3a04868

Please sign in to comment.