From 0426500c048100d746628aab30973cbbafce7c7e Mon Sep 17 00:00:00 2001
From: David Li
Date: Thu, 23 Apr 2026 14:01:49 +0900
Subject: [PATCH 1/2] feat: add support for multiple validation suites
---
adbc_drivers_dev/generate.py | 47 +++++++++++++++++++++++++---
adbc_drivers_dev/templates/test.yaml | 24 ++++++++------
2 files changed, 57 insertions(+), 14 deletions(-)
diff --git a/adbc_drivers_dev/generate.py b/adbc_drivers_dev/generate.py
index ac891ca..3c2b46c 100644
--- a/adbc_drivers_dev/generate.py
+++ b/adbc_drivers_dev/generate.py
@@ -83,6 +83,44 @@ class LangBuildConfig(BaseModel):
)
+class LangValidateSpec(BaseModel):
+ """A single config to validate."""
+
+ model_config = {
+ "extra": "forbid",
+ "validate_by_name": True,
+ "validate_by_alias": True,
+ }
+
+ service_name: str = Field(
+ default="test-service",
+ description="docker-compose service to start",
+ )
+ vendor_version: str = Field(
+ default="",
+ description="version to pass to the validation suite",
+ )
+
+
+class LangValidateConfig(BaseModel):
+ """Options for validation suite."""
+
+ model_config = {
+ "extra": "forbid",
+ "validate_by_name": True,
+ "validate_by_alias": True,
+ }
+
+ skip: bool = Field(
+ default=False,
+ description="Whether to skip the validation suite in CI (this should only be used temporarily while setting up a driver)",
+ )
+ configs: list[LangValidateSpec] = Field(
+ default_factory=lambda: [LangValidateSpec()],
+ description="A list of configurations to run the validation suite with. Each configuration will be run in a separate job",
+ )
+
+
class LangConfig(BaseModel):
model_config = {
"extra": "forbid",
@@ -98,16 +136,15 @@ class LangConfig(BaseModel):
default=None,
description="Override the default subdirectory for this language. Use '.' to place files at the repository root.",
)
+ validate: LangValidateConfig = Field(
+ default_factory=LangValidateConfig,
+ description="Configuration for the driver validation suite.",
+ )
skip_test: bool = Field(
default=False,
alias="skip-test",
description="Whether to skip test workflows (primarily useful for build-only drivers)",
)
- skip_validate: bool = Field(
- default=False,
- alias="skip-validate",
- description="Whether to skip the validation suite in CI (this should only be used temporarily while setting up a driver)",
- )
@model_validator(mode="before")
@classmethod
diff --git a/adbc_drivers_dev/templates/test.yaml b/adbc_drivers_dev/templates/test.yaml
index bd0a258..3de67b6 100644
--- a/adbc_drivers_dev/templates/test.yaml
+++ b/adbc_drivers_dev/templates/test.yaml
@@ -269,16 +269,18 @@ jobs:
<% endif %>
<% endif %>
-<% if not lang_config.skip_validate %>
+<% if not lang_config.validate.skip %>
validate:
- name: "Validate/${{ matrix.platform }}_${{ matrix.arch }}"
+ name: "Validate <{driver}> ${{ matrix.vendor_version }}/${{ matrix.platform }}_${{ matrix.arch }}"
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: true
matrix:
include:
# I think we only need to test one platform, but we can change that later
- - { platform: linux, arch: amd64, runner: ubuntu-latest }
+<% for config in lang_config.validate.configs %>
+ - { platform: linux, arch: amd64, runner: ubuntu-latest, service_name: "<{config.service_name}>", vendor_version: "<{config.vendor_version}>" }
+<% endfor %>
<% if environment and "validate" in lang_config.build.environment_contexts or "build:test" in lang_config.build.environment_contexts %>
environment: <{environment}>
<% endif %>
@@ -390,10 +392,10 @@ jobs:
working-directory: <{ lang_subdir }>
run: |
if [[ -f compose.yaml ]]; then
- if ! docker compose up --detach --wait test-service; then
+ if ! docker compose up --detach --wait ${{ matrix.service_name }}; then
echo "Service failed to start"
echo "Logs:"
- docker compose logs test-service
+ docker compose logs ${{ matrix.service_name }}
exit 1
fi
fi
@@ -422,11 +424,15 @@ jobs:
if [[ -f ci/scripts/pre-test.sh ]]; then
echo "Loading pre-test"
- ./ci/scripts/pre-test.sh ${{ matrix.platform }} ${{ matrix.arch }}
+ ./ci/scripts/pre-test.sh ${{ matrix.platform }} ${{ matrix.arch }} ${{ matrix.service_name }}
fi
docker ps
- pixi run validate
+ if [[ -n "${{ matrix.vendor_version }}" ]]; then
+ pixi run validate --vendor-version "${{ matrix.vendor_version }}"
+ else
+ pixi run validate
+ fi
if [[ -f ci/scripts/post-test.sh ]]; then
./ci/scripts/post-test.sh
@@ -752,7 +758,7 @@ jobs:
needs:
- package
- test-packages
-<% if not lang_config.skip_validate %>
+<% if not lang_config.validate.skip %>
- validate
<% endif %>
permissions:
@@ -798,7 +804,7 @@ jobs:
name: "all-packages"
path: "~/packages"
-<% if not lang_config.skip_validate %>
+<% if not lang_config.validate.skip %>
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: "docs"
From 3bac92ce61cb6befdf6f4b1f7ef2d89cf4e2199f Mon Sep 17 00:00:00 2001
From: David Li
Date: Fri, 24 Apr 2026 11:27:08 +0900
Subject: [PATCH 2/2] fixes
---
adbc_drivers_dev/generate.py | 6 ++--
adbc_drivers_dev/templates/test.yaml | 44 +++++++++++++++++++++++-----
2 files changed, 39 insertions(+), 11 deletions(-)
diff --git a/adbc_drivers_dev/generate.py b/adbc_drivers_dev/generate.py
index 3c2b46c..b819c84 100644
--- a/adbc_drivers_dev/generate.py
+++ b/adbc_drivers_dev/generate.py
@@ -102,7 +102,7 @@ class LangValidateSpec(BaseModel):
)
-class LangValidateConfig(BaseModel):
+class LangValidationConfig(BaseModel):
"""Options for validation suite."""
model_config = {
@@ -136,8 +136,8 @@ class LangConfig(BaseModel):
default=None,
description="Override the default subdirectory for this language. Use '.' to place files at the repository root.",
)
- validate: LangValidateConfig = Field(
- default_factory=LangValidateConfig,
+ validation: LangValidationConfig = Field(
+ default_factory=LangValidationConfig,
description="Configuration for the driver validation suite.",
)
skip_test: bool = Field(
diff --git a/adbc_drivers_dev/templates/test.yaml b/adbc_drivers_dev/templates/test.yaml
index 3de67b6..ec9ddbd 100644
--- a/adbc_drivers_dev/templates/test.yaml
+++ b/adbc_drivers_dev/templates/test.yaml
@@ -269,7 +269,7 @@ jobs:
<% endif %>
<% endif %>
-<% if not lang_config.validate.skip %>
+<% if not lang_config.validation.skip %>
validate:
name: "Validate <{driver}> ${{ matrix.vendor_version }}/${{ matrix.platform }}_${{ matrix.arch }}"
runs-on: ${{ matrix.runner }}
@@ -278,7 +278,7 @@ jobs:
matrix:
include:
# I think we only need to test one platform, but we can change that later
-<% for config in lang_config.validate.configs %>
+<% for config in lang_config.validation.configs %>
- { platform: linux, arch: amd64, runner: ubuntu-latest, service_name: "<{config.service_name}>", vendor_version: "<{config.vendor_version}>" }
<% endfor %>
<% if environment and "validate" in lang_config.build.environment_contexts or "build:test" in lang_config.build.environment_contexts %>
@@ -438,10 +438,12 @@ jobs:
./ci/scripts/post-test.sh
fi
+ cp validation-report.xml validation-report-${{ matrix.vendor_version }}.xml
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
- name: validation-report
- path: "<{ lang_subdir }>/validation-report.xml"
+ name: validation-report-${{ matrix.vendor_version }}
+ path: "<{ lang_subdir }>/validation-report-${{ matrix.vendor_version }}.xml"
retention-days: 7
- name: Generate docs
@@ -453,7 +455,7 @@ jobs:
with:
name: docs
path: "<{ lang_subdir }>/generated/<{driver}>.md"
- retention-days: 2
+ retention-days: 7
<% endif %>
build:
@@ -565,7 +567,11 @@ jobs:
package:
name: "Generate Packages"
runs-on: ubuntu-latest
- needs: build
+ needs:
+ - build
+<% if not lang_config.validation.skip %>
+ - validate
+<% endif %>
permissions:
contents: read
@@ -652,6 +658,28 @@ jobs:
path: ~/packages
retention-days: 7
+<% if not lang_config.validation.skip %>
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ pattern: "validation-report-*"
+ path: "~/validation-report"
+
+ - name: Generate combined docs
+ working-directory: <{ lang_subdir }>
+ run: |
+ ls -laR ~/validation-report
+ find ~/validation-report -type f -name '*.xml'
+ cp $(find ~/validation-report -type f -name '*.xml') .
+ ls *.xml
+ pixi run gendocs --output generated
+
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ with:
+ name: docs-${{ matrix.vendor_version }}
+ path: "<{ lang_subdir }>/generated/<{driver}>.md"
+ retention-days: 2
+<% endif %>
+
test-packages:
name: "Test Packages/${{ matrix.platform }}_${{ matrix.arch }}"
runs-on: ${{ matrix.runner }}
@@ -758,7 +786,7 @@ jobs:
needs:
- package
- test-packages
-<% if not lang_config.validate.skip %>
+<% if not lang_config.validation.skip %>
- validate
<% endif %>
permissions:
@@ -804,7 +832,7 @@ jobs:
name: "all-packages"
path: "~/packages"
-<% if not lang_config.validate.skip %>
+<% if not lang_config.validation.skip %>
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: "docs"