feat: Re-implement CSV download functionality and fix test failures #218
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Run Tests' | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
run-tests: | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
- "3.13" | |
runs-on: ${{matrix.os}} | |
name: '${{matrix.os}} Python ${{matrix.python-version}}' | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade pip | |
shell: bash | |
run: | | |
python3 -m pip install --upgrade pip | |
- name: Install pystackql with all dependencies | |
run: | | |
pip install -e . | |
- name: Install test dependencies | |
run: | | |
pip install pytest>=6.2.5 pytest-cov>=2.12.0 nose>=1.3.7 | |
- name: setup-stackql | |
uses: stackql/[email protected] | |
with: | |
use_wrapper: true | |
- name: Show stackql version (Linux/macOS) | |
if: matrix.os != 'windows-latest' | |
shell: bash | |
run: | | |
stackql --version | |
- name: Show stackql version (Windows) | |
if: matrix.os == 'windows-latest' | |
shell: cmd | |
run: | | |
stackql-bin.exe --version | |
- name: Move stackql binary to temp dir (Linux/macOS) | |
if: matrix.os != 'windows-latest' | |
shell: bash | |
run: | | |
STACKQL_PATH=$(which stackql) | |
mkdir -p /tmp || true | |
cp "$STACKQL_PATH" /tmp/stackql | |
echo "StackQL binary moved from ${STACKQL_PATH} to /tmp/stackql" | |
- name: Move stackql binary to temp dir (Windows) | |
if: matrix.os == 'windows-latest' | |
shell: pwsh | |
run: | | |
$bin = Join-Path $Env:STACKQL_CLI_PATH 'stackql-bin.exe' | |
if (-Not (Test-Path $bin)) { | |
throw "Binary not found at $bin" | |
} | |
Copy-Item $bin -Destination "C:\Temp\stackql.exe" -Force | |
Write-Host "Moved real StackQL binary to C:\Temp\stackql.exe" | |
- name: Run non-server tests | |
env: | |
GITHUB_ACTIONS: 'true' | |
run: | | |
python3 run_tests.py | |
- name: Start StackQL server and run tests (Linux/macOS) | |
if: matrix.os != 'windows-latest' | |
shell: bash | |
env: | |
GITHUB_ACTIONS: 'true' | |
run: | | |
nohup /tmp/stackql -v --pgsrv.port=5466 srv & | |
sleep 5 | |
python3 run_server_tests.py | |
- name: Start StackQL server (Windows) | |
if: matrix.os == 'windows-latest' | |
shell: pwsh | |
run: | | |
Start-Process -FilePath "C:\Temp\stackql.exe" ` | |
-ArgumentList "-v", "--pgsrv.port=5466", "srv" | |
Start-Sleep -Seconds 5 | |
- name: Stop StackQL server (Linux/macOS) | |
if: matrix.os != 'windows-latest' | |
shell: bash | |
run: | | |
echo "Stopping StackQL server on Unix/macOS..." | |
PID=$(pgrep -f "/tmp/stackql.*srv" || pgrep -f "stackql.*srv" || echo "") | |
if [ -z "$PID" ]; then | |
echo "No stackql server process found." | |
else | |
echo "stopping stackql server (PID: $PID)..." | |
kill -9 $PID | |
echo "stackql server stopped." | |
fi | |
- name: Stop StackQL server (Windows) | |
if: matrix.os == 'windows-latest' | |
shell: cmd | |
run: | | |
echo "Stopping StackQL server on Windows..." | |
taskkill /F /IM stackql.exe 2>nul || echo "No stackql.exe process found" | |
echo "StackQL server stopped (Windows)" |