-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add tests for the queries of TPC-H (#899)
- Loading branch information
1 parent
1007352
commit 9eb5f46
Showing
5 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Tests for TPCH Queries | ||
|
||
on: | ||
pull_request: | ||
types: [labeled] | ||
|
||
jobs: | ||
validate-queries: | ||
if: ${{ github.event.label.name == 'full-test' }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.12"] | ||
os: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install uv | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: install-reqs | ||
run: uv pip install --upgrade -r requirements-dev.txt --system | ||
- name: local-install | ||
run: uv pip install -e . --system | ||
- name: generate-data | ||
run: cd tpch && python generate_data.py | ||
- name: tpch-tests | ||
run: python -m unittest discover -s 'tpch/tests' |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
tqdm | ||
covdefaults | ||
duckdb | ||
pandas | ||
|
Empty file.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
import subprocess | ||
import sys | ||
import unittest | ||
from pathlib import Path | ||
|
||
|
||
class TestQueries(unittest.TestCase): | ||
def test_execute_scripts(self) -> None: | ||
root = Path(__file__).resolve().parent.parent | ||
# directory containing all the queries | ||
execute_dir = root / "execute" | ||
|
||
env = os.environ.copy() | ||
env["PYTHONPATH"] = str(root) | ||
|
||
for script_path in execute_dir.glob("q[1-9]*.py"): | ||
result = subprocess.run( # noqa: S603 | ||
[sys.executable, str(script_path)], | ||
capture_output=True, | ||
text=True, | ||
env=env, | ||
cwd=root, | ||
check=False, | ||
shell=False, | ||
) | ||
assert ( | ||
result.returncode == 0 | ||
), f"Script {script_path} failed with error: {result.stderr}" |