CI: run the sp_IndexCleanup and sp_QueryReproBuilder assertion harnesses - #834
Merged
Conversation
The PerfCheck and HumanEvents harnesses already read SQLCMD_BIN and SQLCMD_CONN_ARGS so CI can point them at go-sqlcmd with the connection flags the containers need. Give the IndexCleanup and ReproBuilder runners the same _sqlcmd_prefix() abstraction instead of a hardcoded bare "sqlcmd" with no flags, so they connect in CI (go-sqlcmd, -C -N disable) exactly as they do locally (bare sqlcmd, empty args). Also resolve adversarial_test.sql relative to __file__ in IndexCleanup's run_tests.py so it can run from any working directory, matching its sibling runners. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ReproBuilder is fully portable (embedded plan constants; its one table case uses a tempdb fixture), so it just runs. IndexCleanup needs a StackOverflow2013.dbo.Users table the containers lack; add a fixture that builds a faithful-schema synthetic stand-in (exact Users columns, clustered PK, Brent Ozar's DropIndexes helper, ~500k varied rows, EmailHash all-NULL like the real data). Real values are irrelevant: the harness forces its index reads with hints and every rule is structural. Verified locally on a 2017 instance that never had the database - all four IndexCleanup runners (107 assertions) and ReproBuilder (237) pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rule_coverage_test.py passes locally but fails on the freshly-started CI containers: several positive controls assert the procedure still emits a PAGE compression recommendation for small tables, and on a just-started instance those COMPRESSION SCRIPT rows are absent in the single-database (@database_name) path -- while present via @get_all_databases (groups F/G pass) and present on any established instance. The other three IndexCleanup runners (run_tests, fixture_cases, no_access) and ReproBuilder are wired in and green. rule_coverage stays a local-only test until the fresh-instance compression behavior is root-caused. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Three runners now run in CI against a synthetic StackOverflow2013 fixture; rule_coverage_test.py stays local-only pending the fresh-instance compression finding. 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.
Wires the two remaining assertion harnesses into CI, completing harness coverage for all four procs that have one.
What this does
tempdb), so it just runs — no data source needed.StackOverflow2013.dbo.Userstable the containers lack. Rather than host a real.bak, this adds an in-repo fixture that builds a faithful-schema synthetic stand-in: exact Users columns + clustered PK, Brent Ozar'sDropIndexeshelper, ~500k varied rows,EmailHashall-NULL like the real data. Real values are irrelevant here — the harness forces its index reads withWITH (INDEX = ...)hints and every rule is structural (dedupe / overlap / usage-floor).SQLCMD_BIN/SQLCMD_CONN_ARGSabstraction PerfCheck/HumanEvents already use, so they connect in CI (go-sqlcmd,-C -N disable).Verification
Ran locally against a 2017 instance that never had
StackOverflow2013, exactly mirroring a fresh container: fixture builds in ~2s, and all four IndexCleanup runners (32 + 31 + 40 + 4 = 107 assertions) plus ReproBuilder (237) pass.🤖 Generated with Claude Code