Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
c777335
test: migrate the SQL Server test tree onto the directory-owned tests…
vistart Nov 14, 2026
09cca0a
feat(sqlserver)!: directory-owned fixtures and expression DDL
vistart Nov 15, 2026
4755bfd
fix(dql): synthesize the paging ORDER BY as an expression, not by rep…
vistart Nov 15, 2026
ab86b3a
chore: unstage the in-progress native/adapter test trees (Phase-3 bac…
vistart Nov 15, 2026
511d92b
fix(sqlserver): keep PARAMETERS naming real constructor arguments
vistart Nov 15, 2026
274b1d8
feat: classify the database-assigned column protocol
vistart Nov 15, 2026
184ecdb
chore: unstage the adapter test tree swept into the previous commit
vistart Nov 15, 2026
84bd63b
fix(sqlserver): accept the pinned flag so PARAMETERS names a real arg…
vistart Nov 15, 2026
a05dacd
feat(sqlserver): native-type tests, neutral-type bridges, and the rea…
vistart Nov 15, 2026
9bf93b0
fix(sqlserver): run the native fixture's DDL on its own connection
vistart Nov 15, 2026
81c4222
fix(sqlserver): pin every database-owning backend directory to one wo…
vistart Nov 15, 2026
f31ca16
fix(sqlserver): keep the ODBC connection pool out of the tests
vistart Nov 15, 2026
48c1891
test(sqlserver): move the composite-PK bridge to basic/crud_composite_pk
vistart Nov 15, 2026
0e42d24
test(sqlserver): import the shared fixture vocabulary from its new home
vistart Nov 15, 2026
31da671
refactor(sqlserver): delete the superseded spatial adapter
vistart Nov 16, 2026
1fea0b3
feat(sqlserver): answer the data-type suggestions and rename the subs…
vistart Nov 16, 2026
e0bac7c
test(sqlserver): run the shared suggested-data-type contract
vistart Nov 16, 2026
6101963
feat(sqlserver): answer the six complex families and name a duration …
vistart Nov 16, 2026
b7a6e6d
test(backend): run the typed-column protocol contract in this CI
vistart Nov 16, 2026
e6f1aa3
test(backend): hold the data-type trio to the D9 and substitute contr…
vistart Nov 16, 2026
3d8702b
test(backend): hold formatters and probes to the 1:1 discipline
vistart Nov 16, 2026
563d827
fix(sqlserver): give bare Decimal/datetime lossless suggested columns
vistart Nov 17, 2026
3f625af
test(basic): import the shared type-variant groups
vistart Nov 17, 2026
df4ab4b
test(basic): import the DB-free expressions group
vistart Nov 17, 2026
666af81
test(basic): drop bridges for removed legacy field tests
vistart Nov 17, 2026
2d07f81
test: keep only feature/basic imports from testsuite
vistart Nov 17, 2026
0210f15
test(backend): 按 testsuite 声明式并行机制改造后端自有测试
vistart Nov 17, 2026
48d2926
test: follow the testsuite fixture and naming moves
vistart Nov 17, 2026
be7f045
test: update path comments and fixture import
vistart Nov 17, 2026
4fa0135
test: follow core's dedicated unsupported-data-type error
vistart Nov 18, 2026
e06cc18
test: follow suite declaration and auto-id contracts
vistart Nov 18, 2026
2ac2a4f
feat(ddl): auto-increment suggestions, field generators, and narrowed…
vistart Nov 18, 2026
3c326b8
fix(ddl): restore primary-key identity for native-type models
vistart Nov 18, 2026
4fc5c43
fix(ddl): restore primary-key declarations on backend-local models
vistart Nov 18, 2026
c651be2
fix(ddl): bridge shared long-content models' primary key locally
vistart Nov 18, 2026
95299c3
fix(ddl): correct stale id column-name expressions after auto-increme…
vistart Nov 18, 2026
61c6265
fix(ddl): retire stale non-render pins for declared-result annotations
vistart Nov 18, 2026
cf3652b
test(feature): bridge restructured query/cte/setop/relation/events to…
vistart Nov 19, 2026
7f91f27
ci: include restructured query/cte/setop/query_integration dirs in te…
vistart Nov 19, 2026
7ef4783
ci: run full tests/ tree instead of enumerated feature dirs
vistart Nov 19, 2026
72f140e
fix(bench): repoint relation benchmark conftest to testsuite.feature.…
vistart Nov 19, 2026
e83557b
ci: exclude benchmark tree from the feature test job
vistart Nov 19, 2026
cc3ba10
ci: exclude unrun feature/connection tree with latent Definition.colu…
vistart Nov 19, 2026
9202c81
ci(coverage): narrow coverage source to the package each repo owns
vistart Nov 19, 2026
d15bbd4
test(cli): bridge shared feature/cli contracts with isolated database
vistart Nov 19, 2026
34c2f90
test(explain): add backend-local deep EXPLAIN construction tests for …
vistart Nov 19, 2026
d49f82f
test(explain): skip shared real-DB EXPLAIN contracts on SQL Server
vistart Nov 19, 2026
c74ee6c
test(explain): build EXPLAIN test statement via expression system
vistart Nov 19, 2026
044cfb2
fix(dialect): render scalar EXISTS as T-SQL CASE WHEN
vistart Nov 19, 2026
75173fe
test(benchmark): wire shared testsuite benchmark contracts into SQL S…
vistart Nov 19, 2026
9c0f14d
test(cli): bridge shared migrate CLI contracts
vistart Nov 19, 2026
96c1a1a
test(query): bridge shared testsuite contract dirs
vistart Nov 19, 2026
793f292
test: skip shared contracts unsupported by this backend's driver
vistart Nov 19, 2026
91470e5
test: skip further shared contracts unsupported by this backend
vistart Nov 19, 2026
d64fe22
test: bridge query/relation + typed_column contracts
vistart Nov 20, 2026
c27aa4d
test(sqlserver): self-owned tests for cli/status
vistart Nov 20, 2026
baeee8f
test(sqlserver): self-owned offline tests for status_introspector
vistart Nov 20, 2026
170837c
test(sqlserver): cover async status introspector (native async)
vistart Nov 20, 2026
857404b
test(sqlserver): offline tests for partition maintenance
vistart Nov 20, 2026
105c40a
test(sqlserver): offline tests for ddl/type and cli
vistart Nov 20, 2026
edbc56d
test(sqlserver): live CLI integration tests (info/query/status)
vistart Nov 20, 2026
79197f9
test: bridge DDLSource contracts (ddl/core)
vistart Nov 20, 2026
0d30b52
docs: restructure README to 6-section template + version badge
vistart Nov 20, 2026
9fb9f2a
docs: refine README section title and model mixin annotations
vistart Nov 20, 2026
46ad34a
docs: build out backend docs chapters and examples
vistart Nov 20, 2026
d5ba72c
docs(migration): add backend-specific migration guide and examples
vistart Nov 20, 2026
377a8c7
ci: pin testsuite dependency to release/v1.0.0.dev17
vistart Nov 20, 2026
3eda482
ci: pin core dependency to release/v1.0.0.dev30
vistart Nov 20, 2026
7c76864
chore: add changelog fragment for PR #18
vistart Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
171 changes: 153 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,144 @@ permissions:
contents: read

jobs:
benchmark-sqlserver:
name: Run benchmarks with Python 3.14 and SQL Server 2025
runs-on: ubuntu-24.04
permissions:
contents: read

services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2025-latest
env:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: Password123!
ports:
- 1443:1433
options: >-
--name sqlserver
--health-cmd "/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P 'Password123!' -Q 'SELECT 1' -N -C || exit 1"
--health-interval 10s
--health-timeout 5s
--health-retries 15

steps:
- name: Check out the repository
uses: actions/checkout@v6

- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"

- name: Install ODBC Driver 18 for SQL Server
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev

- name: Install activerecord and testsuite from PyPI
run: |
pip install "rhosocial-activerecord @ git+https://github.com/rhosocial/python-activerecord.git@release/v1.0.0.dev30" # NOSONAR
pip install "rhosocial-activerecord-testsuite @ git+https://github.com/rhosocial/python-activerecord-testsuite.git@release/v1.0.0.dev17" # NOSONAR

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt

- name: Create test database
run: |
python -c "
import pyodbc

connection_string = (
'DRIVER={ODBC Driver 18 for SQL Server};'
'SERVER=localhost,1443;'
'DATABASE=master;'
'UID=sa;'
'PWD=Password123!;'
'TrustServerCertificate=yes;'
'Encrypt=no;'
)

conn = pyodbc.connect(connection_string, autocommit=True)
cursor = conn.cursor()
cursor.execute('CREATE DATABASE test_db')
print('Successfully created test_db')
cursor.close()
conn.close()
"

- name: Create SQL Server scenario config
run: |
cat > sqlserver_scenarios.yaml << EOF
scenarios:
sqlserver_2025:
host: localhost
port: 1443
database: test_db
username: sa
password: Password123!
driver: "ODBC Driver 18 for SQL Server"
encrypt: false
trust_server_certificate: true
autocommit: true
EOF
echo "SQLSERVER_SCENARIOS_CONFIG_PATH=$(pwd)/sqlserver_scenarios.yaml" >> $GITHUB_ENV

- name: Run benchmark suite
run: |
set -o pipefail
export PYTHONPATH=src:tests
TESTSUITE_DIR=$(python - <<'PY'
import pathlib
import rhosocial.activerecord.testsuite as testsuite

print(pathlib.Path(testsuite.__file__).parent)
PY
)
python -m pytest \
-p tests.benchmark.providers \
--rootdir=. \
--confcutdir=. \
"$TESTSUITE_DIR/benchmark/crud/core/test_delete_async.py" \
"$TESTSUITE_DIR/benchmark/crud/core/test_delete.py" \
"$TESTSUITE_DIR/benchmark/crud/core/test_insert_async.py" \
"$TESTSUITE_DIR/benchmark/crud/core/test_insert.py" \
"$TESTSUITE_DIR/benchmark/crud/core/test_query_async.py" \
"$TESTSUITE_DIR/benchmark/crud/core/test_query.py" \
"$TESTSUITE_DIR/benchmark/crud/core/test_update_async.py" \
"$TESTSUITE_DIR/benchmark/crud/core/test_update.py" \
"$TESTSUITE_DIR/benchmark/query" \
"$TESTSUITE_DIR/benchmark/transaction" \
"$TESTSUITE_DIR/benchmark/mixin" \
-m benchmark \
--benchmark-size=small \
--benchmark-sort=mean \
--tb=short | tee -a benchmark-output.txt

- name: Write benchmark conclusion
if: always()
run: |
{
echo "## Python 3.14 / SQL Server 2025 Benchmark Conclusion"
echo
echo "- Python: 3.14"
echo "- SQL Server: 2025"
echo "- Scope: shared testsuite benchmarks (crud/query/transaction/mixin) via registered SQL Server providers"
echo "- Size: small"
echo "- Result: benchmark job fails only when benchmark execution or correctness checks fail."
echo
echo '```text'
grep -A 120 "benchmark:" benchmark-output.txt || cat benchmark-output.txt
echo '```'
} >> "$GITHUB_STEP_SUMMARY"

test-py39-sqlserver2022:
name: Run tests with Python 3.9 and SQL Server 2022
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
Expand Down Expand Up @@ -106,11 +241,11 @@ jobs:
run: |
export PYTHONPATH=src:tests
python tests/enable_read_committed_snapshot.py || true
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x --ignore=tests/benchmark --ignore=tests/rhosocial/activerecord_sqlserver_test/feature/connection

test-py39-sqlserver2017:
name: Run tests with Python 3.9 and SQL Server 2017
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2017-latest
Expand Down Expand Up @@ -196,11 +331,11 @@ jobs:
run: |
export PYTHONPATH=src:tests
python tests/enable_read_committed_snapshot.py || true
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x --ignore=tests/benchmark --ignore=tests/rhosocial/activerecord_sqlserver_test/feature/connection

test-py310-sqlserver2019:
name: Run tests with Python 3.10 and SQL Server 2019
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
Expand Down Expand Up @@ -286,11 +421,11 @@ jobs:
run: |
export PYTHONPATH=src:tests
python tests/enable_read_committed_snapshot.py || true
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x --ignore=tests/benchmark --ignore=tests/rhosocial/activerecord_sqlserver_test/feature/connection

test-py311-sqlserver2019:
name: Run tests with Python 3.11 and SQL Server 2019
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
Expand Down Expand Up @@ -376,11 +511,11 @@ jobs:
run: |
export PYTHONPATH=src:tests
python tests/enable_read_committed_snapshot.py || true
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x --ignore=tests/benchmark --ignore=tests/rhosocial/activerecord_sqlserver_test/feature/connection

test-py312-sqlserver2025:
name: Run tests with Python 3.12 and SQL Server 2025
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2025-latest
Expand Down Expand Up @@ -466,11 +601,11 @@ jobs:
run: |
export PYTHONPATH=src:tests
python tests/enable_read_committed_snapshot.py || true
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x --ignore=tests/benchmark --ignore=tests/rhosocial/activerecord_sqlserver_test/feature/connection

test-py313-sqlserver2022:
name: Run tests with Python 3.13 and SQL Server 2022
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
Expand Down Expand Up @@ -556,11 +691,11 @@ jobs:
run: |
export PYTHONPATH=src:tests
python tests/enable_read_committed_snapshot.py || true
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x --ignore=tests/benchmark --ignore=tests/rhosocial/activerecord_sqlserver_test/feature/connection

test-py313t-sqlserver2019:
name: Run tests with Python 3.13t (free-threaded) and SQL Server 2019
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
continue-on-error: true
services:
sqlserver:
Expand Down Expand Up @@ -647,11 +782,11 @@ jobs:
run: |
export PYTHONPATH=src:tests
python tests/enable_read_committed_snapshot.py || true
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x --ignore=tests/benchmark --ignore=tests/rhosocial/activerecord_sqlserver_test/feature/connection

test-py314-sqlserver2025:
name: Run tests with Python 3.14 and SQL Server 2025
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2025-latest
Expand Down Expand Up @@ -737,7 +872,7 @@ jobs:
run: |
export PYTHONPATH=src:tests
python tests/enable_read_committed_snapshot.py || true
python -m pytest tests/ --tb=short -n 8 --dist=loadgroup --cov=src/rhosocial --cov-branch --cov-report=xml
python -m pytest tests/ --tb=short -n 8 --dist=loadgroup --cov=rhosocial.activerecord.backend.impl.sqlserver --cov-branch --cov-report=xml --ignore=tests/benchmark --ignore=tests/rhosocial/activerecord_sqlserver_test/feature/connection

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand All @@ -750,7 +885,7 @@ jobs:

test-py314t-sqlserver2022:
name: Run tests with Python 3.14t (free-threaded) and SQL Server 2022
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
Expand Down Expand Up @@ -836,4 +971,4 @@ jobs:
run: |
export PYTHONPATH=src:tests
python tests/enable_read_committed_snapshot.py || true
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x
python -m pytest tests/ -n 8 --dist=loadgroup --tb=short -x --ignore=tests/benchmark --ignore=tests/rhosocial/activerecord_sqlserver_test/feature/connection
Loading
Loading