Skip to content

Add automated SQL command testing for docs (EDUENG-131)#23350

Open
ebembi-crdb wants to merge 1 commit into
mainfrom
eeshan/sql-test-automation
Open

Add automated SQL command testing for docs (EDUENG-131)#23350
ebembi-crdb wants to merge 1 commit into
mainfrom
eeshan/sql-test-automation

Conversation

@ebembi-crdb
Copy link
Copy Markdown
Contributor

Summary

  • Adds a Python-based SQL extractor and executor that parses ~~~ sql blocks from markdown docs, classifies them (executable, expected-error, fragment, skipped), and runs them against a CockroachDB cluster
  • Includes a GitHub Actions workflow triggered on PRs (changed v25.4 files), nightly schedule, and manual dispatch, with PR comment reporting on failures
  • Adds sql-test and sql-test-dry-run Makefile targets for local use

Test plan

  • 29 unit tests for the extractor pass (python3 -m pytest .github/scripts/test_sql_extractor.py)
  • Dry-run against select-clause.md correctly extracts 20 executable blocks
  • Dry-run against upsert.md correctly classifies 1 expected-error block
  • Full execution test: start local CockroachDB, run python3 .github/scripts/sql_test_runner.py src/current/v25.4/select-clause.md
  • CI workflow runs with continue-on-error: true (warns but doesn't block PRs)

🤖 Generated with Claude Code

Add infrastructure to extract SQL code blocks from markdown documentation
and execute them against a CockroachDB cluster to verify correctness.
Blocks are classified as executable, expected-error, fragment, or skipped,
with skip annotations supported per-block and per-page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ebembi-crdb ebembi-crdb requested a review from a team as a code owner May 14, 2026 13:54
@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 71f0582
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/6a05d4065eaffa000896f73d

@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 71f0582
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/6a05d40667a4220008c1057a

@github-actions
Copy link
Copy Markdown

Files changed:

  • .github/scripts/sql_test/__init__.py
  • .github/scripts/sql_test/executor.py
  • .github/scripts/sql_test/extractor.py
  • .github/scripts/sql_test/models.py
  • .github/scripts/sql_test/reporter.py
  • .github/scripts/sql_test_runner.py
  • .github/scripts/test_sql_extractor.py
  • .github/workflows/sql-test.yml
  • src/current/Makefile

@netlify
Copy link
Copy Markdown

netlify Bot commented May 14, 2026

Netlify Preview

Name Link
🔨 Latest commit 71f0582
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/6a05d406319a5d0008454699
😎 Deploy Preview https://deploy-preview-23350--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant