-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_python_tests.sh
More file actions
executable file
·55 lines (44 loc) · 1.39 KB
/
run_python_tests.sh
File metadata and controls
executable file
·55 lines (44 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# SQL CLI Python Test Runner
# This script runs all Python tests for the SQL CLI project
set -e # Exit on error
echo "========================================="
echo "SQL CLI Python Test Suite"
echo "========================================="
echo ""
# Check if uv is installed
if ! command -v uv &> /dev/null; then
echo "Error: uv is not installed. Please install uv first."
exit 1
fi
# Build the SQL CLI if not already built
if [ ! -f "target/release/sql-cli" ]; then
echo "Building SQL CLI in release mode..."
cargo build --release
echo "Build complete."
echo ""
fi
# Generate test data if needed
if [ ! -f "data/test_simple_math.csv" ] || [ ! -f "data/test_simple_strings.csv" ]; then
echo "Generating test data..."
uv run python scripts/generate_simple_test.py
echo "Test data generated."
echo ""
fi
# Run the tests
echo "Running Python tests..."
echo "-----------------------------------------"
# Run with verbose output and show summary
# Automatically discover and run all Python tests in tests/python_tests/
uv run pytest tests/python_tests/ -v
# Exit code from pytest
exit_code=$?
echo ""
echo "========================================="
if [ $exit_code -eq 0 ]; then
echo "✅ All Python tests passed!"
else
echo "❌ Some tests failed. Please review the output above."
fi
echo "========================================="
exit $exit_code