Skip to content

serverutils: improve the initialization of TestServer#107808

Merged
craig[bot] merged 6 commits intocockroachdb:masterfrom
knz:20230728-testserver
Jul 28, 2023
Merged

serverutils: improve the initialization of TestServer#107808
craig[bot] merged 6 commits intocockroachdb:masterfrom
knz:20230728-testserver

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Jul 28, 2023

The primary purpose of this patch is to tease out a StartServerOnly() function that doesn't return a *gosql.DB and *kv.DB, to improve readability in those tests that don't need them.

In doing so however, this patch also fixes two bugs:

  • the advertised behavior of StartServer() was to return .ApplicationLayer().DB() in the second return value. However, the code was effectively returning .SystemLayer().DB() instead. This patch fixes it.

  • in case a binary version override was set in the parameters, the expectation is to upgrade both the storage layer and the application layer to the specified version. The code was only upgrading the application layer. This patch fixes it.

Release note: None
Epic: CRDB-28893

@knz knz requested review from healthy-pod and stevendanna July 28, 2023 17:20
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@knz knz added the db-cy-23 label Jul 28, 2023
@knz knz force-pushed the 20230728-testserver branch from 847fcbf to 1a86fe2 Compare July 28, 2023 17:22
Copy link
Copy Markdown
Collaborator

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

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

LGTM. Good catch.

Copy link
Copy Markdown
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.

Nice find! :lgtm:

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


-- commits line 11 at r1:
nit: s/second/third/.

Copy link
Copy Markdown
Contributor Author

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

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @healthy-pod and @yuzefovich)


-- commits line 11 at r1:

Previously, yuzefovich (Yahor Yuzefovich) wrote…

nit: s/second/third/.

Fixed.

@knz knz force-pushed the 20230728-testserver branch from 1a86fe2 to 5c4ab43 Compare July 28, 2023 18:46
@knz knz requested a review from a team July 28, 2023 18:46
@knz knz requested a review from a team as a code owner July 28, 2023 18:46
@knz knz requested a review from a team July 28, 2023 18:46
@knz knz requested review from a team as code owners July 28, 2023 18:46
@knz knz requested a review from a team July 28, 2023 18:46
@knz knz requested review from a team as code owners July 28, 2023 18:46
@knz knz requested a review from a team July 28, 2023 18:46
@knz knz requested review from a team as code owners July 28, 2023 18:46
@knz knz requested review from Santamaura and removed request for a team July 28, 2023 18:46
@knz knz requested review from herkolategan, miretskiy and srosenberg and removed request for a team July 28, 2023 18:46
Copy link
Copy Markdown
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.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @healthy-pod, @herkolategan, @knz, @miretskiy, @msirek, @Santamaura, and @srosenberg)


pkg/testutils/lint/lint_test.go line 595 at r5 (raw file):

			"grep",
			"-nE",
			`, _, _ := serverutils\.StartServer\(`,

nit: perhaps make colon optional, i.e. , _, _ :?= serverutils\.StartServer\(.

@knz knz force-pushed the 20230728-testserver branch 2 times, most recently from 19634af to dff547e Compare July 28, 2023 19:35
Copy link
Copy Markdown
Contributor Author

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @healthy-pod, @herkolategan, @miretskiy, @msirek, @Santamaura, @srosenberg, and @yuzefovich)


pkg/testutils/lint/lint_test.go line 595 at r5 (raw file):

Previously, yuzefovich (Yahor Yuzefovich) wrote…

nit: perhaps make colon optional, i.e. , _, _ :?= serverutils\.StartServer\(.

Done.

@knz knz force-pushed the 20230728-testserver branch 3 times, most recently from ee85a2f to 7ea9228 Compare July 28, 2023 21:17
@knz knz force-pushed the 20230728-testserver branch from 7ea9228 to 257bc95 Compare July 28, 2023 21:50
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Jul 28, 2023

TFYRs!

bors r=stevendanna,yuzefovich

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Jul 28, 2023

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • We notice you have more than one commit in your PR. We try break logical changes into separate commits, but commits such as "fix typo" or "address review commits" should be squashed into one commit and pushed with --force
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@blathers-crl blathers-crl bot added the O-community Originated from the community label Jul 28, 2023
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 28, 2023

Canceled.

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Jul 28, 2023

bors r=stevendanna,yuzefovich

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Jul 28, 2023

bors r-

There's a merge conflict with #107757 which is in the bors queue already.

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 28, 2023

Canceled.

knz added 5 commits July 28, 2023 23:55
The primary purpose of this patch is to tease out a
`StartServerOnly()` function that doesn't return a `*gosql.DB` and
`*kv.DB`, to improve readability in those tests that don't need them.

In doing so however, this patch also fixes two bugs:

- the advertised behavior of  `StartServer()` was to return
  `.ApplicationLayer().DB()` in the third return value. However,
  the code was effectively returning `.SystemLayer().DB()` instead.
  This patch fixes it.

- in case a binary version override was set in the parameters,
  the expectation is to upgrade both the storage layer
  and the application layer to the specified version.
  The code was only upgrading the application layer.
  This patch fixes it.

Release note: None
In those tests that don't need a client connection, this
simplification removes the overhead of setting up the TLS certs on
disk.

Release note: None
@knz knz force-pushed the 20230728-testserver branch from 257bc95 to 68abba0 Compare July 28, 2023 22:05
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Jul 28, 2023

bors r=stevendanna,yuzefovich

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 28, 2023

Build succeeded:

@craig craig bot merged commit 8f7fb8c into cockroachdb:master Jul 28, 2023
@knz knz deleted the 20230728-testserver branch July 29, 2023 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db-cy-23 O-community Originated from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants