You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
go_library(
name="main",
deps= [
"//server", # keep: prevent Gazelle from changing this to //server/integrationtests
...
],
...
)
server/integrationtests/BUILD.bazel
go_library(
name="integrationtests",
testonly=1,
embed= [
"//server", # keep: integrationtests wraps server for testing
...
],
...
)
I think Gazelle is confused because of the embed. Whenever I run it it did remove the //server dependency from the main library. The keep above prevents Gazelle from removing it. But Gazelle is still adding the reference to integrationtests. Is there a way to make Gazelle honor the testonly attribute? It shouldn't add a testonly dependency to a none-test dependency.
The only workaround I found is this directive:
# gazelle:resolve go github.com/for/bar/server //server
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have three libraries:
main/BUILD.bazelserver/integrationtests/BUILD.bazelI think Gazelle is confused because of the
embed. Whenever I run it it did remove the//serverdependency from themainlibrary. Thekeepabove prevents Gazelle from removing it. But Gazelle is still adding the reference tointegrationtests. Is there a way to make Gazelle honor thetestonlyattribute? It shouldn't add atestonlydependency to a none-test dependency.The only workaround I found is this directive:
# gazelle:resolve go github.com/for/bar/server //serverBeta Was this translation helpful? Give feedback.
All reactions