Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: remove createTestServerParams #143115

Merged

Conversation

shubhamdhama
Copy link
Contributor

@shubhamdhama shubhamdhama commented Mar 19, 2025

The only remaining use of createTestServerParams was in TestIndexMutationKVOps, but that test is really something the SQL queries team better suited to handle. So, I swapped it out for createTestServerParamsAllowTenants and override DefaultTestTenant with an appropriate one (tracked in #143114).

Now that's taken care of, createTestServerParams is fully gone—one less way for test authors to accidentally skip running tests with tenants.

Next step: we should rename createTestServerParamsAllowTenants back to createTestServerParams to keep things tidy.

Closes: #140446
Epic: CRDB-48564
Release note: none

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the deprecated function createTestServerParams and updates test configurations to use createTestServerParamsAllowTenants instead, while overriding DefaultTestTenant appropriately for tenant testing. Key changes include:

  • Replacing createTestServerParams with createTestServerParamsAllowTenants in TestIndexMutationKVOps.
  • Overriding DefaultTestTenant with a tenant-specific function.
  • Removing createTestServerParams from server_params_test.go.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/sql/index_mutation_test.go Updated test configuration to leverage tenant support properly.
pkg/sql/server_params_test.go Removed the deprecated createTestServerParams function.
Comments suppressed due to low confidence (1)

pkg/sql/index_mutation_test.go:40

  • [nitpick] Consider renaming 'TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet' to a shorter, more descriptive name to improve clarity, as suggested in the PR description.
params.DefaultTestTenant = base.TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet(143114)
Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: 🎉

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @shubhamdhama)

The only remaining use of `createTestServerParams` was in
`TestIndexMutationKVOps`, but that test is really something the SQL queries
team better suited to handle. So, I swapped it out for
`createTestServerParamsAllowTenants` and override `DefaultTestTenant` with
`TestDoesNotWorkWithSecondaryTenantsButWeDontKnowWhyYet` (tracked in cockroachdb#143114).

Now that's taken care of, `createTestServerParams` is fully gone—one less
way for test authors to accidentally skip running tests with tenants.

Next step: we should rename `createTestServerParamsAllowTenants` back
to `createTestServerParams` to keep things tidy.

Fixes: cockroachdb#140446
Epic: CRDB-48564
Release note: none
@shubhamdhama shubhamdhama force-pushed the remove-createTestServerParams branch from b2944de to 3a789bf Compare March 20, 2025 08:30
@shubhamdhama
Copy link
Contributor Author

Thanks for the review!

bors r=yuzefovich

@craig
Copy link
Contributor

craig bot commented Mar 20, 2025

@craig craig bot merged commit ee4e53b into cockroachdb:master Mar 20, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pkg/sql: remove usages of createTestServerParams to increase tenant testing coverage
3 participants