Skip to content

Commit

Permalink
Split dialect from driver, part 3: Re-activate integration-/doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Dec 21, 2023
1 parent c86a4b3 commit af5f967
Show file tree
Hide file tree
Showing 23 changed files with 432 additions and 434 deletions.
41 changes: 27 additions & 14 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:

jobs:
nightly:
name: "Python: ${{ matrix.python-version }}
SQLA: ${{ matrix.sqla-version }}
CrateDB: ${{ matrix.cratedb-version }}
on ${{ matrix.os }}"
name: "
Python: ${{ matrix.python-version }}
SQLAlchemy: ${{ matrix.sqla-version }}
CrateDB: ${{ matrix.cratedb-version }}
"
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -37,29 +38,41 @@ jobs:
PIP_ALLOW_PRERELEASE: ${{ matrix.pip-allow-prerelease }}

steps:
- uses: actions/checkout@v4

- name: Acquire sources
uses: actions/checkout@v4

- name: Run CrateDB
run: docker compose -f tests/docker-compose.yml up -d

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: 'setup.py'
cache-dependency-path:
pyproject.toml

- name: Invoke tests
- name: Set up project
run: |
# Propagate build matrix information.
./devtools/setup_ci.sh
# `setuptools 0.64.0` adds support for editable install hooks (PEP 660).
# https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400
pip install "setuptools>=64" --upgrade
# Install package in editable mode.
pip install --use-pep517 --prefer-binary --editable='.[develop,test]'
- name: Invoke tests
run: |
# Bootstrap environment.
source bootstrap.sh
# Report about the test matrix slot.
echo "Invoking tests with CrateDB ${CRATEDB_VERSION} and SQLAlchemy ${SQLALCHEMY_VERSION}"
# Run linter.
flake8 src bin
# Run tests.
# Run linters and software tests.
export SQLALCHEMY_WARN_20=1
bin/test -vvv
poe check
32 changes: 13 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,30 @@ concurrency:

jobs:
test:
name: "Python: ${{ matrix.python-version }}
SQLA: ${{ matrix.sqla-version }}
on ${{ matrix.os }}"
name: "
Python: ${{ matrix.python-version }}
SQLAlchemy: ${{ matrix.sqla-version }}
"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest']
os: ['ubuntu-latest']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
cratedb-version: ['5.4.5']
cratedb-version: ['5.5.1']
sqla-version: ['<1.4', '<1.5', '<2.1']
pip-allow-prerelease: ['false']

exclude:
# To save resources, only use the most recent Python versions on macOS.
- os: 'macos-latest'
python-version: '3.7'
- os: 'macos-latest'
python-version: '3.8'
- os: 'macos-latest'
python-version: '3.9'
- os: 'macos-latest'
python-version: '3.10'
# SQLAlchemy 1.3 is not supported on Python 3.12 and higher.
- os: 'ubuntu-latest'
python-version: '3.12'
sqla-version: '<1.4'
- os: 'macos-latest'
python-version: '3.12'
sqla-version: '<1.4'

# Another CI test matrix slot to test against prerelease versions of Python packages.
include:
- os: 'ubuntu-latest'
python-version: '3.12'
cratedb-version: '5.4.5'
cratedb-version: '5.5.1'
sqla-version: 'latest'
pip-allow-prerelease: 'true'

Expand All @@ -59,7 +48,12 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

steps:
- uses: actions/checkout@v4

- name: Acquire sources
uses: actions/checkout@v4

- name: Run CrateDB
run: docker compose -f tests/docker-compose.yml up -d

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand Down
13 changes: 6 additions & 7 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@ This command should automatically install all prerequisites for the
development sandbox and drop you into the virtualenv, ready for invoking
further commands.

## Running tests
## Running Tests

All tests will be invoked using the Python interpreter that was used
when creating the Python virtualenv.

Some examples how to invoke the test runner are outlined below.

Run all tests:
Verify code by running all linters and software tests:

docker compose -f tests/docker-compose.yml up
poe check

Run specific tests:

pytest -k SqlAlchemyCompilerTest
pytest -k test_score

# Integration tests, written as doctests.
python -m unittest -vvv tests/integration.py

Format code:

poe format
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# set -x

# Default variables.
CRATEDB_VERSION=${CRATEDB_VERSION:-5.2.2}
CRATEDB_VERSION=${CRATEDB_VERSION:-5.5.1}
SQLALCHEMY_VERSION=${SQLALCHEMY_VERSION:-<2.1}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _sqlalchemy-advanced-querying:
.. _advanced-querying:

=============================
SQLAlchemy: Advanced querying
=============================
=================
Advanced querying
=================

This section of the documentation demonstrates running queries using a fulltext
index with an analyzer, queries using counting and aggregations, and support for
Expand Down
30 changes: 0 additions & 30 deletions docs/by-example/index.rst

This file was deleted.

Loading

0 comments on commit af5f967

Please sign in to comment.