-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add v2 buf.yaml LintWithWorkspaceTest test cases #215
Conversation
f7805bd
to
d9a71cc
Compare
d9a71cc
to
9f5e9f4
Compare
|
||
@Test | ||
fun `lint a basic correct message with default config v2`() { | ||
super.`lint a basic correct message with default config`() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh. Do you have plans to hoist this up into the base test classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you suggest as a good idiom for two tests that do exactly the same thing but use different resource dirs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only added a _v2
test for cases that contain a buf.work.yaml
file, which are generally the WithWorkspace
tests. Accordingly I define these cases only in the leaf classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good idiom for exactly this case. My question was more about: these super
tests are also applicable to situations in which ones doesn't use workspaces, and those still run against v1 buf.yaml
s. Defining these tests in the base classes will allow the test suite to declare it supports v2 configs for each of the three scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The super
function is itself a @Test
case that runs against the resource dir that does not end with _v2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right - and would it also make sense to run v2
tests against a "vanilla" project (i.e., one not using workspaces)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to test against every version of Buf CLI - apart from some edge cases which we unfortunately ran into, it is meant to be fully backwards compatible.
@@ -72,7 +72,7 @@ abstract class AbstractBufIntegrationTest : IntegrationTest { | |||
"-PkotlinVersion=1.7.20", | |||
"-PandroidGradleVersion=7.3.0", | |||
) | |||
.withDebug(false) // Enable for interactive debugging | |||
.withDebug(true) // Enable for interactive debugging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this affect anything if you don't want to debug? E.g. does it let tests run to completion or does it stop and wait for a debugger to attach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I will put this back, it was just for my own debugging but I like having the explicit set to false
to make it easy to see where to set it.
@@ -0,0 +1,3 @@ | |||
version: v2 | |||
modules: | |||
- path: workspace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own understanding - is buf.work.yaml
just not a thing anymore in v2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From https://buf.build/docs/configuration/v1/buf-work-yaml
:
Buf now has a v2 configuration available, where this file is no longer used.
No description provided.