Skip to content

Add CI: automated SQL Server testing on PRs #664

@erikdarlingdata

Description

@erikdarlingdata

Summary

Add a GitHub Actions workflow that automatically tests all stored procedures against SQL Server 2019 and 2022 on every PR. This catches syntax errors, runtime failures, and version-specific regressions before they reach manual testing.

Proposed Workflow

File: .github/workflows/sql-tests.yml

Triggers: PR to dev/main, push to dev

Matrix: SQL Server 2019 + 2022 (parallel, fail-fast: false)

Steps:

  1. Spin up SQL Server in Docker (mcr.microsoft.com/mssql/server)
  2. Create test database with Query Store enabled
  3. Install all procs from Install-All/DarlingData.sql
  4. Verify all 9 procedures exist (OBJECT_ID checks)
  5. Run @help = 1 for every procedure
  6. Run default execution for safe procs (sp_PressureDetector, sp_PerfCheck, sp_HealthParser, sp_LogHunter, sp_IndexCleanup, sp_QuickieStore)
  7. Help-only for procs needing XE/special setup (sp_HumanEvents, sp_HumanEventsBlockViewer, sp_QueryReproBuilder)

What this catches:

  • Syntax errors in any procedure
  • Runtime failures on specific SQL Server versions
  • Missing object references
  • Parameter validation issues
  • Regressions when modifying procedures

Test Files

  • .github/sql/test_help_output.sql — TRY/CATCH @help = 1 per proc
  • .github/sql/test_basic_execution.sql — Default execution for safe procs

Notes

  • sp_QueryStoreCleanup excluded (destructive, not in DarlingData.sql)
  • Uses mssql-tools18 with -C -No flags for both versions
  • Each version runs independently so one failure doesn't block the other

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions