CI: run the sp_PerfCheck and sp_HumanEvents assertion harnesses - #833
Merged
Conversation
The sql-tests workflow only ran basic-execution and help-output smoke tests, so the assertion harnesses added recently ran only when someone remembered to. That gap is exactly how behavioral regressions shipped: a harness existed but nothing ran it. This wires the two self-contained harnesses into CI so they run on every push to dev and every PR, across the 2017/2019/2022/2025 matrix. PerfCheck and HumanEvents build and drop their own scratch databases, Extended Events sessions, and configuration, so they need no external data - unlike the IndexCleanup and ReproBuilder harnesses, which depend on StackOverflow2013 that the CI containers do not have (a later phase). The harnesses were written and validated against the go-based sqlcmd, so CI now installs that package (already available from the Microsoft apt repo it configures) alongside mssql-tools18, rather than risk output-parsing differences from a different client. The harnesses' sqlcmd invocation is made configurable through two environment variables - SQLCMD_BIN (default "sqlcmd") and SQLCMD_CONN_ARGS (default empty) - so the same code runs locally unchanged and in CI with "-C" to trust the container's self-signed certificate. Both changes are no-ops locally: harnesses still pass 53/53 and 195/195 against SQL2022. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… runners) The 'sqlcmd' apt package is not in the Microsoft repo for the ubuntu-noble runners (E: Unable to locate package sqlcmd). Pull the latest linux-amd64 go-sqlcmd release binary instead, install to /usr/local/bin/sqlcmd, and point the harness steps at it explicitly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e procs The harnesses connect to master (as on a local box), but CI installed the procs only into DarlingData_CI_Test, so the preflight reported sp_PerfCheck missing. Add a master install before the harness steps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…s runs on Linux Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On Linux SQL Server sys.traces still lists a default trace, but fn_trace_gettable cannot read it there and raises Msg 19049, which aborted the whole procedure before it returned any findings. Wrap the default-trace read in TRY/CATCH: on failure leave #trace_events empty (the trace-based checks below then simply find nothing) and record one informational finding (check_id 5004) noting the trace was unreadable. Also covers a missing or corrupt trace file on Windows. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The go-sqlcmd the harnesses use failed to connect to the SQL Server 2017 container instantly: the modern Go TLS stack rejects that old container's self-signed certificate outright, and -C (trust cert) does not bypass it, so the harness read the empty result as "proc not installed." Disable encryption (-N disable) so no TLS handshake happens - there is nothing to secure on a localhost throwaway container. Removes the temporary continue-on-error on the sp_PerfCheck step now that it degrades cleanly on Linux and passes there. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The "zero net configuration change" meta-assertion failed on the SQL Server 2017 CI container: its image ships 'clr strict security' configured on but not yet in use (value=1, value_in_use=0), a staged change. The harness's own RECONFIGURE (for its SAFE_OPTIONS) applied that pending change mid-run, so it surfaced as a net config change the harness never made. Issue RECONFIGURE before capturing the baseline so the comparison measures only the harness's own effect. Verified by staging an equivalent pending change locally: fails without this, passes with it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
sql-testsworkflow only ran basic-execution and help-output smoke tests, so the assertion harnesses ran only when someone remembered to. That gap is exactly how behavioral regressions shipped this cycle — a harness existed but nothing ran it. This wires the two self-contained harnesses into CI so they run on every push todevand every PR, across the 2017/2019/2022/2025 matrix.Why only these two (for now)
sp_PerfCheckandsp_HumanEventsbuild and drop their own scratch databases, Extended Events sessions, and configuration — no external data needed.sp_IndexCleanupandsp_QueryReproBuilderdepend onStackOverflow2013, which the CI containers don't have; those are a later phase (their fixtures need to build their own data).How
sqlcmd, so CI installs that package (already in the Microsoft apt repo it configures) alongsidemssql-tools18, rather than risk output-parsing differences from a different client.sqlcmdinvocation is now configurable viaSQLCMD_BIN(defaultsqlcmd) andSQLCMD_CONN_ARGS(default empty), so the same code runs locally unchanged and in CI with-Cto trust the container cert.Validation
Tests + CI only — no procedure
.sqltouched, no version bumps.🤖 Generated with Claude Code