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

Make ConfigurationTest success check more robust #221

Merged
merged 5 commits into from
Jul 30, 2024

Conversation

drice-buf
Copy link
Contributor

No description provided.

@drice-buf drice-buf requested review from jhump and andrewparmet July 30, 2024 15:43
@@ -44,7 +44,6 @@ class ConfigurationTest : AbstractBufIntegrationTest() {
}

private fun assertSuccess() {
val result = gradleRunner().withArguments(":tasks").build()
assertThat(result.output).doesNotContain("cannot use both the protobuf-gradle-plugin and a Buf workspace")
assertThat(gradleRunner().withArguments(":tasks").build().output.contains("BUILD SUCCESSFUL"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think build() itself verifies success, but this doesn't hurt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess there's no need for any kind of assert in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

Choose a reason for hiding this comment

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

Did you happen to verify that no assertion was needed (like tweaking the config files to expect failure and making sure the test fails)? If so, LGTM!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I was able to verify that the test will fail if there is any sort of build error in the resources dir. I also am adding a couple more test cases to nail things down.

@drice-buf drice-buf force-pushed the drice/improve_configuration_test branch 2 times, most recently from 0b4c989 to 394f376 Compare July 30, 2024 16:31
@drice-buf drice-buf requested a review from andrewparmet July 30, 2024 16:32
jhump
jhump previously approved these changes Jul 30, 2024
@drice-buf drice-buf force-pushed the drice/improve_configuration_test branch from 1e8bf3e to bd5f6ab Compare July 30, 2024 16:47
@drice-buf drice-buf requested a review from jhump July 30, 2024 16:47
@@ -28,23 +28,28 @@ class ConfigurationTest : AbstractBufIntegrationTest() {
assertFailure()
}

@Test
fun `project cannot use buf yaml workspaces and the protobuf gradle plugin first`() {
Copy link
Member

Choose a reason for hiding this comment

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

For naming consistency with the other test cases, maybe "project cannot use buf-work-yaml and the protobuf-gradle-plugin, protobuf applied first"? Or does this new name miss the intent of this test case?

@drice-buf drice-buf merged commit 0147a49 into main Jul 30, 2024
8 checks passed
@drice-buf drice-buf deleted the drice/improve_configuration_test branch July 30, 2024 18:25
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