Skip to content

sql: refactor deps tests to use bazel#79409

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:deps
Apr 5, 2022
Merged

sql: refactor deps tests to use bazel#79409
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:deps

Conversation

@yuzefovich
Copy link
Copy Markdown
Member

@yuzefovich yuzefovich commented Apr 5, 2022

This commit refactors most VerifyNoImports dependency tests in the sql
folder to use the newly introduced bazel test utilities.

Release note: None

Jira issue: CRDB-14814

This commit refactors most `VerifyNoImports` dependency tests in the sql
folder to use the newly introduced bazel test utilities.

Release note: None
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@yuzefovich yuzefovich marked this pull request as ready for review April 5, 2022 06:18
@yuzefovich yuzefovich requested a review from a team as a code owner April 5, 2022 06:18
@yuzefovich yuzefovich requested review from a team and ajwerner April 5, 2022 06:18
Copy link
Copy Markdown
Collaborator

@rickystewart rickystewart left a comment

Choose a reason for hiding this comment

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

Nice!

@ajwerner
Copy link
Copy Markdown
Contributor

ajwerner commented Apr 5, 2022

Your flake, womp womp: (53100) in-mem temp storage: disk budget exceeded: 1048576 bytes requested, 104857600 currently allocated, 104857600 bytes in budget

https://teamcity.cockroachdb.com/buildConfiguration/Cockroach_UnitTests_BazelUnitTests/4795705?showRootCauses=false&expandBuildChangesSection=true&expandBuildProblemsSection=true&expandBuildTestsSection=true

Are there features regarding prefixes or allowed package which would make this easier or better?

@michae2
Copy link
Copy Markdown
Collaborator

michae2 commented Apr 5, 2022

Newbie question: why do we disallow these imports? Is it to prevent layer violations in the vectorized engine?

@yuzefovich
Copy link
Copy Markdown
Member Author

The flake appears to be known (#74554).

Are there features regarding prefixes or allowed package which would make this easier or better?

I don't think so - all tests that are converted in this PR didn't use those features, and it was pretty simple to convert them to the new format. One thing I noticed is that some of the prohibited dependencies would form import cycles if they were actual dependencies, so I guess I could have trimmed down the lists a bit, but I decided to not think too much and converted things as is. There were a couple of failures though, so I had to adjust the lists. Still, the process was quite straightforward, thanks for setting it up!

TFTRs!

bors r+

@yuzefovich
Copy link
Copy Markdown
Member Author

Newbie question: why do we disallow these imports? Is it to prevent layer violations in the vectorized engine?

No, mostly to make the packages that are imported in many places lightweight - recent example, a change in roachpb up until recently forced rebuilding of execgen which forced regeneration all of the vectorized code, so the build times would sky-rocket.

@rickystewart
Copy link
Copy Markdown
Collaborator

There were a couple of failures though, so I had to adjust the lists.

It would be very helpful if you could provide a list of the deps you had to delete to get these tests to pass. Would be great if we could drill down on the forbidden imports that got introduced due to bitrot and start addressing them.

@yuzefovich
Copy link
Copy Markdown
Member Author

There were a couple of failures though, so I had to adjust the lists.

It would be very helpful if you could provide a list of the deps you had to delete to get these tests to pass. Would be great if we could drill down on the forbidden imports that got introduced due to bitrot and start addressing them.

Sorry, I should have been more specific. I don't think any of the dependencies were bad - the tests were broken when they were introduced. A couple of examples: colexecproj/dep_test.go was "asserting" that colexecbase is not imported, but in fact it is, and that's ok; execgen was asserting that sql/tree is not imported - such package doesn't exist, it should have been sql/sem/tree. All the changes in this PR were not concerning at all.

@michae2
Copy link
Copy Markdown
Collaborator

michae2 commented Apr 5, 2022

Newbie question: why do we disallow these imports? Is it to prevent layer violations in the vectorized engine?

No, mostly to make the packages that are imported in many places lightweight - recent example, a change in roachpb up until recently forced rebuilding of execgen which forced regeneration all of the vectorized code, so the build times would sky-rocket.

Makes sense, thank you!

@ajwerner
Copy link
Copy Markdown
Contributor

ajwerner commented Apr 5, 2022

The way I see it, this test is primarily about enforcing dependency graph hygiene.

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 5, 2022

Build failed (retrying...):

@craig craig bot merged commit 985344a into cockroachdb:master Apr 5, 2022
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 5, 2022

Build succeeded:

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.

5 participants