@@ -13,6 +13,8 @@ unset uv_install_flags
1313unset no_commit_pin
1414unset venv_dir
1515unset dry_run
16+ unset oldest
17+ unset no_special
1618declare -a from_source_specs=()
1719
1820SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
@@ -23,9 +25,11 @@ usage(){
2325Usage: $0
2426 [ --repo_home input]
2527 [ --target_env_name input ]
28+ [ --oldest ] # Use oldest CI requirements (Python 3.10, requirements-oldest.txt)
2629 [ --torch_dev_ver input ]
2730 [ --torch_test_channel ]
2831 [ --no_rebuild_base ]
32+ [ --no-special ] # Skip special tests (standalone/experimental), run only main test suite
2933 [ --include_experimental ]
3034 [ --uv_install_flags "flags" ]
3135 [ --no_commit_pin ]
@@ -35,26 +39,28 @@ Usage: $0
3539 [ --help ]
3640 Examples:
3741 # generate fts_latest coverage without rebuilding the fts_latest base environment:
38- # ./gen_fts_coverage.sh --repo_home=${HOME} /repos/finetuning-scheduler --target_env_name=fts_latest --no_rebuild_base
42+ # ./gen_fts_coverage.sh --repo_home=\$ {HOME}/repos/finetuning-scheduler --target_env_name=fts_latest --no_rebuild_base
43+ # generate oldest CI build coverage (matches CI oldest matrix):
44+ # ./gen_fts_coverage.sh --repo_home=\$ {HOME}/repos/finetuning-scheduler --target_env_name=fts_oldest --oldest --no-special --venv-dir=/mnt/cache/\$ {USER}/.venvs
3945 # generate fts_latest coverage with a given torch_dev_version:
40- # ./gen_fts_coverage.sh --repo_home=${HOME} /repos/finetuning-scheduler --target_env_name=fts_latest --torch_dev_ver=dev20240201
46+ # ./gen_fts_coverage.sh --repo_home=\ $ {HOME}/repos/finetuning-scheduler --target_env_name=fts_latest --torch_dev_ver=dev20240201
4147 # generate fts_latest coverage, rebuilding base fts_latest with PyTorch test channel and run tests that require experimental patches:
42- # ./gen_fts_coverage.sh --repo_home=${HOME} /repos/finetuning-scheduler --target_env_name=fts_latest --torch_test_channel --include_experimental
48+ # ./gen_fts_coverage.sh --repo_home=\ $ {HOME}/repos/finetuning-scheduler --target_env_name=fts_latest --torch_test_channel --include_experimental
4349 # generate fts_release coverage, rebuilding the base fts_release environment with PyTorch stable channel:
44- # ./gen_fts_coverage.sh --repo_home=${HOME} /repos/fts-release --target_env_name=fts_release
50+ # ./gen_fts_coverage.sh --repo_home=\ $ {HOME}/repos/fts-release --target_env_name=fts_release
4551 # generate fts_release coverage, rebuilding the base fts_release environment with PyTorch test channel:
46- # ./gen_fts_coverage.sh --repo_home=${HOME} /repos/fts-release --target_env_name=fts_release --torch_test_channel
52+ # ./gen_fts_coverage.sh --repo_home=\ $ {HOME}/repos/fts-release --target_env_name=fts_release --torch_test_channel
4753 # generate fts_latest coverage with explicit venv directory (recommended for hardlink performance):
48- # ./gen_fts_coverage.sh --repo_home=${HOME} /repos/finetuning-scheduler --target_env_name=fts_latest --venv-dir=/mnt/cache/\$ {USER}/.venvs
54+ # ./gen_fts_coverage.sh --repo_home=\ $ {HOME}/repos/finetuning-scheduler --target_env_name=fts_latest --venv-dir=/mnt/cache/\$ {USER}/.venvs
4955 # generate fts_release coverage without using CI commit pinning:
50- # ./gen_fts_coverage.sh --repo_home=${HOME} /repos/fts-release --target_env_name=fts_release --no_commit_pin
56+ # ./gen_fts_coverage.sh --repo_home=\ $ {HOME}/repos/fts-release --target_env_name=fts_release --no_commit_pin
5157 # dry-run mode: setup environment and show what tests would run without executing them:
52- # ./gen_fts_coverage.sh --repo_home=${HOME} /repos/finetuning-scheduler --target_env_name=fts_latest --torch_dev_ver=dev20240201 --dry-run
58+ # ./gen_fts_coverage.sh --repo_home=\ $ {HOME}/repos/finetuning-scheduler --target_env_name=fts_latest --torch_dev_ver=dev20240201 --dry-run
5359EOF
5460exit 1
5561}
5662
57- args=$( getopt -o ' ' --long repo_home:,target_env_name:,torch_dev_ver:,torch_test_channel,no_rebuild_base,include_experimental,uv_install_flags:,no_commit_pin,venv-dir:,from-source:,dry-run,help -- " $@ " )
63+ args=$( getopt -o ' ' --long repo_home:,target_env_name:,oldest, torch_dev_ver:,torch_test_channel,no_rebuild_base,no-special ,include_experimental,uv_install_flags:,no_commit_pin,venv-dir:,from-source:,dry-run,help -- " $@ " )
5864if [[ $? -gt 0 ]]; then
5965 usage
6066fi
6571 case $1 in
6672 --repo_home) repo_home=$2 ; shift 2 ;;
6773 --target_env_name) target_env_name=$2 ; shift 2 ;;
74+ --oldest) oldest=1 ; shift ;;
6875 --torch_dev_ver) torch_dev_ver=$2 ; shift 2 ;;
6976 --torch_test_channel) torch_test_channel=1 ; shift ;;
7077 --no_rebuild_base) no_rebuild_base=1 ; shift ;;
78+ --no-special) no_special=1 ; shift ;;
7179 --include_experimental) include_experimental=1 ; shift ;;
7280 --uv_install_flags) uv_install_flags=$2 ; shift 2 ;;
7381 --no_commit_pin) no_commit_pin=1 ; shift ;;
@@ -121,6 +129,11 @@ env_rebuild(){
121129 # Build command arguments array
122130 local -a cmd_args=(" ${repo_home} /scripts/build_fts_env.sh" " --repo_home=${repo_home} " " --target_env_name=$1 " )
123131
132+ # Add oldest flag if specified
133+ if [[ $oldest -eq 1 ]]; then
134+ cmd_args+=(" --oldest" )
135+ fi
136+
124137 # Add uv_install_flags if specified
125138 if [[ -n " ${uv_install_flags} " ]]; then
126139 cmd_args+=(" --uv_install_flags=${uv_install_flags} " )
@@ -145,7 +158,7 @@ env_rebuild(){
145158 log_msg " Executing build command: ${cmd_args[*]} "
146159
147160 case $1 in
148- fts_latest)
161+ fts_latest|fts_oldest )
149162 if [[ -n ${torch_dev_ver} ]]; then
150163 cmd_args+=(" --torch_dev_ver=${torch_dev_ver} " )
151164 elif [[ $torch_test_channel -eq 1 ]]; then
@@ -212,18 +225,23 @@ collect_env_coverage(){
212225 fi
213226
214227 case $1 in
215- fts_latest|fts_release|$all_supported_pattern )
228+ fts_latest|fts_oldest| fts_release|$all_supported_pattern )
216229 log_msg " Erasing previous coverage data"
217230 python -m coverage erase
218231 log_msg " Running main test suite with coverage"
219232 python -m coverage run --append --source src/finetuning_scheduler -m pytest src/finetuning_scheduler tests -v 2>&1 >> $coverage_session_log
220- log_msg " Running standalone tests (pattern: test_f)"
221- (./tests/special_tests.sh --mark_type=standalone --filter_pattern=' test_f' --log_file=${coverage_session_log} 2>&1 >> ${temp_special_log} ) > /dev/null
222- if [[ $include_experimental -eq 1 ]]; then
223- log_msg " Running tests that require experimental patches using $1 "
224- (./tests/special_tests.sh --mark_type=exp_patch --filter_pattern=' test_f' --log_file=${coverage_session_log} --experiment_patch_mask=" 1 0 0 1" 2>&1 >> ${temp_special_log} ) > /dev/null
233+ # Skip special tests if --no-special flag is set
234+ if [[ $no_special -eq 1 ]]; then
235+ log_msg " Skipping special tests (--no-special flag set)"
225236 else
226- log_msg " Skipping tests that require experimental patches."
237+ log_msg " Running standalone tests (pattern: test_f)"
238+ (./tests/special_tests.sh --mark_type=standalone --filter_pattern=' test_f' --log_file=${coverage_session_log} 2>&1 >> ${temp_special_log} ) > /dev/null
239+ if [[ $include_experimental -eq 1 ]]; then
240+ log_msg " Running tests that require experimental patches using $1 "
241+ (./tests/special_tests.sh --mark_type=exp_patch --filter_pattern=' test_f' --log_file=${coverage_session_log} --experiment_patch_mask=" 1 0 0 1" 2>&1 >> ${temp_special_log} ) > /dev/null
242+ else
243+ log_msg " Skipping tests that require experimental patches."
244+ fi
227245 fi
228246 ;;
229247 * )
255273log_msg " Generating base coverage for the FTS env ${target_env_name} "
256274env_rebuild_collect " ${target_env_name} "
257275case ${target_env_name} in
258- fts_latest|$supported_fts_latest_pattern )
276+ fts_latest|fts_oldest| $supported_fts_latest_pattern )
259277 log_msg " No env-specific additional coverage currently required for ${target_env_name} "
260278 ;;
261279 fts_release|$supported_fts_release_pattern )
0 commit comments