Skip to content

CI: run the sp_IndexCleanup and sp_QueryReproBuilder assertion harnesses - #834

Merged
erikdarlingdata merged 4 commits into
devfrom
ci/harnesses-in-ci-phase2
Jul 18, 2026
Merged

CI: run the sp_IndexCleanup and sp_QueryReproBuilder assertion harnesses#834
erikdarlingdata merged 4 commits into
devfrom
ci/harnesses-in-ci-phase2

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Wires the two remaining assertion harnesses into CI, completing harness coverage for all four procs that have one.

What this does

  • ReproBuilder is fully portable (embedded plan constants; its one table-dependent case builds a fixture in tempdb), so it just runs — no data source needed.
  • IndexCleanup needs a StackOverflow2013.dbo.Users table 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's DropIndexes helper, ~500k varied rows, EmailHash all-NULL like the real data. Real values are irrelevant here — the harness forces its index reads with WITH (INDEX = ...) hints and every rule is structural (dedupe / overlap / usage-floor).
  • Gives the IndexCleanup/ReproBuilder runners the same SQLCMD_BIN/SQLCMD_CONN_ARGS abstraction 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

erikdarlingdata and others added 4 commits July 18, 2026 07:43
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>
@erikdarlingdata
erikdarlingdata merged commit 125faa5 into dev Jul 18, 2026
5 checks passed
@erikdarlingdata
erikdarlingdata deleted the ci/harnesses-in-ci-phase2 branch July 18, 2026 12:14
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