chore: type check test container tests (#36790)

This commit is contained in:
Escape0707
2026-05-29 10:54:25 +09:00
committed by GitHub
parent 13eaa436e7
commit a180ab19e4
2 changed files with 210 additions and 8 deletions
+28 -8
View File
@@ -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"