diff --git a/graph_net/test/batch_init_input_tensor_constraints_test.sh b/graph_net/test/batch_init_input_tensor_constraints_test.sh index c90c5f868..b0f750005 100644 --- a/graph_net/test/batch_init_input_tensor_constraints_test.sh +++ b/graph_net/test/batch_init_input_tensor_constraints_test.sh @@ -26,4 +26,4 @@ EOF ) CONFIG=$(echo $config_json_str | base64 -w 0) -python3 -m graph_net.model_path_handler --model-path-list $GRAPH_NET_ROOT/config/torch_samples_list.txt --handler-config=$CONFIG +python3 -m graph_net.model_path_handler --model-path-list $GRAPH_NET_ROOT/config/small10_torch_samples_list.txt --handler-config=$CONFIG diff --git a/graph_net/test/dtype_gen_test.sh b/graph_net/test/dtype_gen_test.sh index 546835680..5aee7d334 100755 --- a/graph_net/test/dtype_gen_test.sh +++ b/graph_net/test/dtype_gen_test.sh @@ -8,7 +8,7 @@ mkdir -p "$OUTPUT_DIR" # Step 1: Initialize dtype generalization passes (samples of torchvision) python3 -m graph_net.apply_sample_pass \ - --model-path-list "graph_net/config/small100_torch_samples_list.txt" \ + --model-path-list "graph_net/config/small10_torch_samples_list.txt" \ --sample-pass-file-path "$GRAPH_NET_ROOT/torch/sample_pass/dtype_generalizer.py" \ --sample-pass-class-name InitDataTypeGeneralizationPasses \ --sample-pass-config $(base64 -w 0 <=5.26.1" > /dev/null + [ $? -ne 0 ] && LOG "[FATAL] Install grpcio or protobuf failed!" && exit -1 + LOG "[INFO] grpcio and protobuf installed successfully." } function run_unit_test() { UNITTEST_PATH="$GRAPH_NET_ROOT/graph_net/torch/unittest" @@ -39,9 +44,43 @@ function run_unit_test() { return $RET } +function run_shell_tests() { + TEST_DIR="$GRAPH_NET_ROOT/graph_net/test" + SKIP_LIST=("cumsum_num_kernels_test.sh" "prologue_subgraph_unittest_generator_test.sh") + LOG "[INFO] Looking for shell scripts in: $TEST_DIR" + + mkdir -p .tmp_bin + PY310_PATH=$(which python3.10) + ln -sf "$PY310_PATH" .tmp_bin/python + ln -sf "$PY310_PATH" .tmp_bin/python3 + export PATH="$(pwd)/.tmp_bin:$PATH" + + SCRIPTS=("$TEST_DIR"/*.sh) + for script in "${SCRIPTS[@]}"; do + script_name=$(basename "$script") + if [[ " ${SKIP_LIST[*]} " =~ " $script_name " ]]; then + continue + fi + + LOG "[INFO] Running script: $script_name" + chmod +x "$script" + "$script" || { + EXIT_CODE=$? + LOG "[ERROR] $script_name failed with exit code $EXIT_CODE" + return $EXIT_CODE + } + LOG "[SUCCESS] $script_name finished successfully." + done + + rm -rf .tmp_bin + LOG "[INFO] All shell scripts passed successfully!" + return 0 +} + function main() { prepare_torch_env run_unit_test + run_shell_tests } main \ No newline at end of file