diff --git a/.kokoro/presubmit/sqlalchemy_compliance.cfg b/.kokoro/presubmit/sqlalchemy_compliance.cfg new file mode 100644 index 000000000000..891deec4aa4e --- /dev/null +++ b/.kokoro/presubmit/sqlalchemy_compliance.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Only run compliance nox session. +env_vars: { + key: "NOX_SESSION" + value: "compliance" +} diff --git a/.kokoro/presubmit/system.cfg b/.kokoro/presubmit/system.cfg index 789455bd6973..f01fa3c46e72 100644 --- a/.kokoro/presubmit/system.cfg +++ b/.kokoro/presubmit/system.cfg @@ -5,3 +5,9 @@ env_vars: { key: "NOX_SESSION" value: "system-3.12" } + +# Skip compliance tests in system job since they run in dedicated compliance job +env_vars: { + key: "RUN_COMPLIANCE_TESTS" + value: "false" +} diff --git a/.kokoro/system.sh b/.kokoro/system.sh index 91d96e7a1497..2b06d445964a 100755 --- a/.kokoro/system.sh +++ b/.kokoro/system.sh @@ -263,6 +263,12 @@ for path in `find 'packages' \ files_to_check=("${package_path}") fi + # When running compliance tests, only test packages that have compliance suites + if [[ "${NOX_SESSION:-}" == "compliance"* && "${package_name:-}" != "sqlalchemy-"* ]]; then + printf "SKIP %-20s %-40s %s\n" "[not_applicable]" "${package_name}" "${commit_hash:-HEAD}" + continue + fi + set +e # Passing the array expanded as arguments to git diff. package_modified=$(git diff "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT}" -- "${files_to_check[@]}" | wc -l) diff --git a/packages/sqlalchemy-bigquery/README.rst b/packages/sqlalchemy-bigquery/README.rst index 0c31785fa9fe..8e8586154eaa 100644 --- a/packages/sqlalchemy-bigquery/README.rst +++ b/packages/sqlalchemy-bigquery/README.rst @@ -3,7 +3,7 @@ SQLAlchemy Dialect for BigQuery |GA| |pypi| |versions| -`SQLALchemy Dialects`_ +`SQLAlchemy Dialects`_ - `Dialect Documentation`_ - `Product Documentation`_ diff --git a/packages/sqlalchemy-spanner/README.rst b/packages/sqlalchemy-spanner/README.rst index fc9e5b6c0f75..8847473419dc 100644 --- a/packages/sqlalchemy-spanner/README.rst +++ b/packages/sqlalchemy-spanner/README.rst @@ -4,7 +4,7 @@ Spanner dialect for SQLAlchemy Spanner dialect for SQLAlchemy represents an interface API designed to make it possible to control Cloud Spanner databases with SQLAlchemy API. The dialect is built on top of `the Spanner DB -API `__, +API `__, which is designed in accordance with `PEP-249 `__. diff --git a/packages/sqlalchemy-spanner/noxfile.py b/packages/sqlalchemy-spanner/noxfile.py index df709c96e50a..26a5a0f0e647 100644 --- a/packages/sqlalchemy-spanner/noxfile.py +++ b/packages/sqlalchemy-spanner/noxfile.py @@ -177,7 +177,7 @@ def lint_setup_py(session): session.run("python", "setup.py", "check", "--restructuredtext", "--strict") -@nox.session(python=UNIT_TEST_PYTHON_VERSIONS[0]) +@nox.session(python=SYSTEM_COMPLIANCE_MIGRATION_TEST_PYTHON_VERSIONS[0]) def compliance_test_14(session): """Run SQLAlchemy dialect compliance test suite.""" config_file = f"test_compliance_14_{session.python}_{uuid.uuid4().hex[:6]}.cfg" @@ -484,10 +484,10 @@ def system(session, test_type): "Credentials or emulator host must be set via environment variable" ) - if os.environ.get("RUN_COMPLIANCE_TESTS", "true") == "false" and not os.environ.get( + if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false" and not os.environ.get( "SPANNER_EMULATOR_HOST", "" ): - session.skip("RUN_COMPLIANCE_TESTS is set to false, skipping") + session.skip("RUN_SYSTEM_TESTS is set to false, skipping") if test_type == "system" and session.python not in SYSTEM_TEST_PYTHON_VERSIONS: session.skip("Standard system tests configured to run exclusively on 3.12") @@ -524,6 +524,16 @@ def system(session, test_type): ) +@nox.session(python=SYSTEM_COMPLIANCE_MIGRATION_TEST_PYTHON_VERSIONS) +@nox.parametrize( + "test_type", + ["compliance_14", "compliance_20"], +) +def compliance(session, test_type): + """Run SQLAlchemy dialect compliance test suite.""" + system(session, test_type=test_type) + + @nox.session(python=DEFAULT_PYTHON_VERSION) def mypy(session): """Run the type checker."""