Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d6c8779
chore: Add 3.14 and 3.14t builds: update GHA matrix, bump uv and cibu…
paultiq Sep 14, 2025
69415c1
chore: remove pandas 3.0 warnings -> instead, disable pandas for 3.14…
paultiq Sep 14, 2025
ded40ec
test: Disable Pandas for 3.14
paultiq Sep 14, 2025
2ad0350
test: disable failing test "Windows fatal exception: access violation"
paultiq Sep 15, 2025
557df24
tests: skip, don't xfail
paultiq Sep 15, 2025
b4e404e
exclude Windows
paultiq Sep 15, 2025
a540862
tests: revert the skip since we're excluding Windows 3.14t builds ent…
paultiq Sep 15, 2025
3f8c7d7
revert: import that was added, no longer needed
paultiq Sep 15, 2025
8b11bc4
revert: exactly to original
paultiq Sep 15, 2025
6c35985
test: Mark test xfail
paultiq Sep 15, 2025
64b70d6
test: mark test xfail
paultiq Sep 15, 2025
80c57b0
chore: Add comments and todo's for workflow changes
paultiq Sep 15, 2025
e315bb7
chore: Remove unused section for Windows 3.14t builds.
paultiq Sep 15, 2025
fd26187
chore: Add version check to only allow no-Pandas for 3.14, plus a TODO
paultiq Sep 15, 2025
6044ea0
tests: Narrow pandas not installed skip to duckdb.InvalidInputException
paultiq Sep 15, 2025
d899bcf
tests: revert xfail for 3.14 now that #48 is merged
paultiq Sep 16, 2025
889699b
Merge branch 'main' into ci314t
evertlammerts Sep 16, 2025
83d839c
Python 3.14 / 3.14t builds (#50)
evertlammerts Sep 17, 2025
c535a23
Packaging workflow should respect the 'minimal' input param
evertlammerts Sep 17, 2025
c592c6e
tests: Use a unique file for each database, for concurrent test isola…
paultiq Sep 17, 2025
624891b
tests: pytest plugins: randomly to randomize order, xdist for multipr…
paultiq Sep 17, 2025
1d39069
tests: using a tmp_path_factory for concurrent testing
paultiq Sep 17, 2025
b21a5bf
tests: add a 2 minute test timeout. Tests can override this with @pyt…
paultiq Sep 17, 2025
98f3668
tests: 2 minutes
paultiq Sep 17, 2025
f6e0cd9
tests: modify tests to be threading safe *or* explicitly marked as un…
paultiq Sep 17, 2025
c0ec7f1
revert
paultiq Sep 17, 2025
8d8e06e
tests: add workflow to do random, multiprocess and multithreaded tests.
paultiq Sep 17, 2025
fc1538d
tests: Use unique table names for each test so tests can run in any o…
paultiq Sep 17, 2025
45e7ae3
tests: Move the slow 10M test to tests/slow
paultiq Sep 17, 2025
543654b
tests: use tmp_path so each test gets unique test.db
paultiq Sep 17, 2025
beb0325
tests: use a tmp_path to allow concurrent tests
paultiq Sep 17, 2025
90d746d
tests: pytest.raises KeyboardInterrupt and use a long-running query
paultiq Sep 17, 2025
ac39dbb
test: fix test to handle keyboard & runtime error, and use a longer q…
paultiq Sep 17, 2025
8b1a564
also on PR
paultiq Sep 17, 2025
6af1e9f
set defaults for PR
paultiq Sep 17, 2025
b97f5b5
run on push
paultiq Sep 17, 2025
27e9488
set defaults sensibly
paultiq Sep 17, 2025
43af69a
ci: fix yaml
paultiq Sep 17, 2025
f5396ff
ci: env var
paultiq Sep 17, 2025
11880f3
ci: disable ccache install
paultiq Sep 17, 2025
8772bbe
ci: use defaults
paultiq Sep 17, 2025
36f42f6
Merge branch 'ci314t_sccache' into randomly
paultiq Sep 17, 2025
8e0836b
ci: add comments
paultiq Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 169 additions & 0 deletions .github/workflows/additional_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: Stress Tests
on:
push:
workflow_dispatch:
inputs:
os:
description: Operating System
required: true
type: choice
default: ubuntu-24.04
options:
- windows-2025
- ubuntu-24.04
- ubuntu-24.04-arm
- macos-15
- macos-13
python_version:
description: Python Version
required: true
type: choice
default: cp314
options:
- cp39
- cp310
- cp311
- cp312
- cp313
- cp314
- cp314t
- cp315
- cp315t
testsuite:
type: choice
description: Testsuite to run (fast, all)
required: true
default: fast
options:
- fast
- all
duckdb-python-sha:
type: string
description: The commit or ref to build against (defaults to latest commit of current ref)
required: false
duckdb-sha:
type: string
description: Override the DuckDB submodule commit or ref to build against
required: false
test_iterations:
type: number
description: Number of times to run each test phase
required: false
default: 3

env:
OS_TO_USE: ${{ inputs.os || 'ubuntu-24.04' }}
PYTHON_VERSION_TO_USE: ${{ inputs.python_version || 'cp314' }}
TESTSUITE_TO_USE: ${{ inputs.testsuite || 'fast' }}
ITERATIONS_TO_USE: ${{ inputs.test_iterations || '3' }}
# Disable the ccache install
CIBW_BEFORE_BUILD: ''


jobs:
build:
name: "Build wheel: ${{ inputs.python_version || 'cp314' }}-${{ inputs.os || 'ubuntu-24.04' }}"
runs-on: ${{ inputs.os || 'ubuntu-24.04' }}

steps:
- name: Checkout DuckDB Python
uses: actions/checkout@v4
with:
ref: ${{ inputs.duckdb-python-sha }}
fetch-depth: 0
submodules: true

- name: Checkout DuckDB
shell: bash
if: ${{ inputs.duckdb-sha }}
run: |
cd external/duckdb
git fetch origin
git checkout ${{ inputs.duckdb-sha }}

- uses: astral-sh/setup-uv@v6
with:
version: "0.8.16"
enable-cache: false
cache-suffix: -${{ env.PYTHON_VERSION_TO_USE }}-${{ env.OS_TO_USE }}
python-version: ${{ env.PYTHON_VERSION_TO_USE }}

- name: Build wheel
uses: pypa/[email protected]
env:
CIBW_ARCHS: auto
CIBW_BUILD: ${{ env.PYTHON_VERSION_TO_USE }}-*
CIBW_TEST_SKIP: '*'

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-${{ env.PYTHON_VERSION_TO_USE }}-${{ env.OS_TO_USE }}
path: wheelhouse/

test:
name: 'Test: ${{ matrix.pytest_config.name }} - ${{ inputs.python_version }}-${{ inputs.os }}'
runs-on: ${{ inputs.os }}
needs: build
strategy:
fail-fast: false
matrix:
pytest_config:
- name: "Random Order" # randomization is automatic due to pytest-randomly
args: ""
iterations: ${{ inputs.test_iterations || 3 }}
- name: "Multiprocess" # uses pytest-xdist
args: "-n auto"
iterations: ${{ inputs.test_iterations || 3 }}
- name: "Threaded" # uses pytest-run-parallel
# TODO: Update to use threading specific tests or explicitly mark unsafe tests. test_module was chosen as an example.
args: "--parallel-threads=4 --iterations=8 tests/fast/test_module.py --ignore"
iterations: 1

steps:
- name: Checkout DuckDB Python
uses: actions/checkout@v4
with:
ref: ${{ inputs.duckdb-python-sha }}
fetch-depth: 0
submodules: true

- uses: astral-sh/setup-uv@v6
with:
version: "0.8.16"
enable-cache: false
cache-suffix: -${{ env.PYTHON_VERSION_TO_USE }}-${{ env.OS_TO_USE }}
python-version: ${{ env.PYTHON_VERSION_TO_USE }}

- name: Download wheel
uses: actions/download-artifact@v4
with:
name: wheel-${{ env.PYTHON_VERSION_TO_USE }}-${{ env.OS_TO_USE }}
path: wheelhouse/

- name: Install dependencies
shell: bash
run: |
uv export --only-group test --no-emit-project --output-file pylock.toml
uv pip install -r pylock.toml
uv pip install wheelhouse/*.whl

- name: Run ${{ matrix.pytest_config.name }} tests
shell: bash
run: |
TEST_TARGET="${{ inputs.testsuite == 'fast' && 'tests/fast' || 'tests' }}"
ITERATIONS="${{ matrix.pytest_config.iterations }}"
PYTEST_ARGS="${{ matrix.pytest_config.args }}"

echo "Running ${{ matrix.pytest_config.name }} pytest $ITERATIONS times against: $TEST_TARGET"
for i in $(seq 1 $ITERATIONS); do
echo ""
echo "${{ matrix.pytest_config.name }} Run $i/$ITERATIONS:"
echo "--------"
uv run pytest $PYTEST_ARGS "$TEST_TARGET" --durations=5
if [ $? -ne 0 ]; then
echo "${{ matrix.pytest_config.name }} Run $i failed!"
else
echo "${{ matrix.pytest_config.name }} Run $i passed!"
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
name: Build and test releases
uses: ./.github/workflows/packaging_wheels.yml
with:
minimal: false
minimal: ${{ inputs.minimal }}
testsuite: all
duckdb-python-sha: ${{ inputs.duckdb-python-sha != '' && inputs.duckdb-python-sha || github.sha }}
duckdb-sha: ${{ inputs.duckdb-sha }}
Expand Down
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ test = [ # dependencies used for running tests
"pytest",
"pytest-reraise",
"pytest-timeout",
"pytest-xdist", # Parallel (multi-process)
# "pytest-randomly", # Randomizes order of tests
"pytest-xdist", # multi-processed tests, if `-n <num_workers> | auto`
"pytest-randomly", # randomizes test order to ensure no test dependencies, enabled on install
"pytest-run-parallel", # multi-threaded tests, if `--parallel-threads=N --iterations=N`
"pytest-timestamper", # Adds timestamps to test output
"pytest-run-parallel", # For free-threading testing
"mypy",
"coverage",
"gcovr; python_version < '3.14'",
Expand Down Expand Up @@ -310,6 +310,7 @@ filterwarnings = [
"ignore:distutils Version classes are deprecated:DeprecationWarning",
"ignore:is_datetime64tz_dtype is deprecated:DeprecationWarning",
]
timeout = 120 # don't let individual tests run for more than 5 minutes

[tool.coverage.run]
branch = true
Expand Down
10 changes: 4 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def pytest_runtest_call(item):
if sys.version_info[:2] == (3, 14):
try:
outcome.get_result()
except Exception as e:
except duckdb.InvalidInputException as e:
if "'pandas' is required for this operation but it was not installed" in str(e):
pytest.skip("pandas not available - test requires pandas functionality")
else:
Expand Down Expand Up @@ -267,11 +267,9 @@ def spark():


@pytest.fixture(scope='function')
def duckdb_cursor():
connection = duckdb.connect('')
yield connection
connection.close()

def duckdb_cursor(tmp_path):
with duckdb.connect(tmp_path / "mytest") as connection:
yield connection

@pytest.fixture(scope='function')
def integers(duckdb_cursor):
Expand Down
Loading
Loading