mirror of
https://github.com/langgenius/dify.git
synced 2026-06-06 16:10:07 +08:00
chore: type check test container tests (#36790)
This commit is contained in:
+28
-8
@@ -7,6 +7,8 @@ REPO_ROOT="$SCRIPT_DIR/.."
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
EXCLUDES_FILE="api/pyrefly-local-excludes.txt"
|
||||
TEST_CONTAINERS_DIR="tests/test_containers_integration_tests"
|
||||
TEST_CONTAINERS_CONFIG="$TEST_CONTAINERS_DIR/pyrefly.toml"
|
||||
|
||||
target_paths=()
|
||||
for target_path in "$@"; do
|
||||
@@ -33,7 +35,22 @@ if [[ -f "$EXCLUDES_FILE" ]]; then
|
||||
done < "$EXCLUDES_FILE"
|
||||
fi
|
||||
|
||||
tmp_output="$(mktemp)"
|
||||
run_pyrefly() {
|
||||
local tmp_output
|
||||
tmp_output="$(mktemp)"
|
||||
|
||||
set +e
|
||||
"$@" >"$tmp_output" 2>&1
|
||||
local pyrefly_status=$?
|
||||
set -e
|
||||
|
||||
uv run --directory api python libs/pyrefly_diagnostics.py < "$tmp_output"
|
||||
rm -f "$tmp_output"
|
||||
return "$pyrefly_status"
|
||||
}
|
||||
|
||||
status=0
|
||||
|
||||
pyrefly_command=(
|
||||
uv run --directory api --dev pyrefly check
|
||||
"${pyrefly_args[@]}"
|
||||
@@ -42,12 +59,15 @@ if (( ${#target_paths[@]} > 0 )); then
|
||||
pyrefly_command+=("${target_paths[@]}")
|
||||
fi
|
||||
|
||||
set +e
|
||||
"${pyrefly_command[@]}" >"$tmp_output" 2>&1
|
||||
pyrefly_status=$?
|
||||
set -e
|
||||
run_pyrefly "${pyrefly_command[@]}" || status=$?
|
||||
|
||||
uv run --directory api python libs/pyrefly_diagnostics.py < "$tmp_output"
|
||||
rm -f "$tmp_output"
|
||||
if (( ${#target_paths[@]} == 0 )); then
|
||||
run_pyrefly \
|
||||
uv run --directory api --dev pyrefly check \
|
||||
"--summary=none" \
|
||||
"--use-ignore-files=false" \
|
||||
"--config=$TEST_CONTAINERS_CONFIG" \
|
||||
|| status=$?
|
||||
fi
|
||||
|
||||
exit "$pyrefly_status"
|
||||
exit "$status"
|
||||
|
||||
Reference in New Issue
Block a user