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 calls to CreateTestServerParams #107765

Merged
merged 4 commits into from
Aug 2, 2023

Conversation

yuzefovich
Copy link
Member

@yuzefovich yuzefovich commented Jul 27, 2023

This PR removes calls to tests.CreateTestServerParams outside of sql_test tests as well as does some miscellaneous cleanups along the way. The rationale for doing this is that vast majority of callers didn't actually need the setup performed by the helper but inherited the disabling of test tenant. It seems more prudent for each test to be explicit about the kind of testing knobs and settings it needs.

Informs: #76378.
Epic: CRDB-18499.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich yuzefovich force-pushed the tt-helper branch 7 times, most recently from 28eed02 to a2e46c2 Compare July 29, 2023 01:35
@yuzefovich yuzefovich marked this pull request as ready for review July 29, 2023 01:35
@yuzefovich yuzefovich requested a review from a team as a code owner July 29, 2023 01:35
@yuzefovich yuzefovich requested a review from a team July 29, 2023 01:35
@yuzefovich yuzefovich requested review from a team as code owners July 29, 2023 01:35
@yuzefovich yuzefovich requested a review from a team July 29, 2023 01:35
@yuzefovich yuzefovich requested review from a team as code owners July 29, 2023 01:35
@yuzefovich yuzefovich requested review from rytaft, Santamaura, smg260 and renatolabs and removed request for a team July 29, 2023 01:35
Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

LGTM with nits.

Reviewed 5 of 5 files at r1, 72 of 72 files at r2, 8 of 8 files at r3, 45 of 46 files at r4, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @stevendanna and @yuzefovich)


pkg/sql/schemachanger/scbuild/builder_test.go line 296 at r2 (raw file):

	systemDB := s.SystemLayer().SQLConn(t, "")
	_, err := systemDB.Exec(`ALTER TENANT ALL SET CLUSTER SETTING "spanconfig.tenant_limit" = 10000000`)

May I suggest a setting override? The ALTER TENANT ALL propagates async with a rangefeed.


pkg/sql/tests/random_schema_test.go line 46 at r2 (raw file):

	systemDB := s.SystemLayer().SQLConn(t, "")
	_, err := systemDB.Exec(`ALTER TENANT ALL SET CLUSTER SETTING "spanconfig.tenant_limit" = 10000000`)

ditto

This commit refactors `TestValidateSystemSchemaAfterBootStrap` to be run
against the test tenant. Given that the system schema is different for
system and application tenants, a new `bootstrap_tenant` file is
introduced.

Release note: None
This commit removes all calls to `tests.CreateTestServerParams` outside
of `sql` and `sql_test` tests. The following commit will move and
unexport this method.

Miscellaneous items:
- enable ccl license in many touched packages
- adjust some tests to work with test tenant
- rename pkg/sql/pgrepl/pgrepl_test.go -> pkg/sql/pgrepl/main_test.go
- unexport `AOSTClause` from `sqlstats.TestingKnobs`
- sprinkle some log scopes.

Release note: None
It doesn't seem that useful - it only sets SQLStats testing knob which
I don't think any of the tests actually need.

Release note: None
Now that `tests.CreateTestServerParams` is only used from within `sql`
folder, this helper is now moved into the `sql` package. Also, in order to
unexport the helper to prevent it from polluting other packages
unnecessarily, this commit removes all callers of the helper that are in
`sql` test package (as opposed to `sql_test`).

Release note: None
Copy link
Member Author

@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.

TFTR!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @knz and @stevendanna)


pkg/sql/schemachanger/scbuild/builder_test.go line 296 at r2 (raw file):

Previously, knz (Raphael 'kena' Poss) wrote…

May I suggest a setting override? The ALTER TENANT ALL propagates async with a rangefeed.

The setting is not exported, so I reverted back to the testing knob.


pkg/sql/tests/random_schema_test.go line 46 at r2 (raw file):

Previously, knz (Raphael 'kena' Poss) wrote…

ditto

Done.

@craig
Copy link
Contributor

craig bot commented Aug 2, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Aug 2, 2023

Build succeeded:

@craig craig bot merged commit 729212e into cockroachdb:master Aug 2, 2023
2 checks passed
@yuzefovich yuzefovich deleted the tt-helper branch August 2, 2023 23:12
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.

3 participants