Skip to content

Create the documented indexes before running a case - #4575

Open
evanchooly wants to merge 1 commit into
audits-find-updatefrom
audits-indexes
Open

evanchooly wants to merge 1 commit into
audits-find-updatefrom
audits-indexes

Conversation

@evanchooly

Copy link
Copy Markdown
Member

One of the plan's deferred cutover features. Stacked on #4574.

Problem

Seven $text cases stayed legacy-only in cutover.json with "the page creates an index, which the runner does not seed yet". $text needs a text index, so each page starts with one:

db.articles.createIndex( { subject: "text" } )
db.articles.find( { $text: { $search: "coffee" } } )

Lowering already parsed createIndex (ShellPrograms returns an IndexOperation), but FormMigration.documented refused any example with an index block, and OperatorCaseRunner refused any scenario with a non-empty indexes.

Change

  • Lowering: FormMigration.documented lowers index blocks as setup commands beside the inserts. DocumentedScenario.indexes keeps each one's collection, keys and options.
  • Scenario: indexes lists {collection, keys, options}. A converted or generated scenario without indexes is unchanged.
  • Runner:
    • after seeding, it creates each index on both databases through createIndexes, so every option the page passes (for example default_language) reaches the server unchanged;
    • an unnamed index gets the shell's default name: its keys and values joined by underscores;
    • an index entry with other fields is refused.
  • The seven $text cases convert and pass: caseAndDiacriticInsensitivity, caseSensitivity, excludeDocumentsThatContainATerm, matchAnyOfTheSearchTerms, queryADifferentLanguage, textWithASingleWord and textWithAnExactString. cutover.json drops them; the manifest and ledger are regenerated.

Result

370 legacy cases are on the runner, 186 legacy directories are left, and 16 cases are legacy-only.

Verification

  • TestText (9, the 7 converted cases among them) passes under Critter, then reflection.
  • Core operator tests: 692 pass under both mappers.
  • Audits suite: 458 pass under both mappers. GeneratorTest.findsAndUpdatesAreGenerated now checks that a page's createIndex with a name reaches the generated scenario.

Self-reviewed only: the independent reviewers are out of quota until 2026-11-26.

A page's createIndex blocks lower as setup, and the scenario's indexes
list each with its collection, keys and options. The runner creates them
on both databases after seeding. The seven $text cases that stayed on
the legacy path because their page creates a text index now convert and
pass under both mappers.

This branch has not been deployed

No deployments
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