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

Introduce a mechanism to obtain the build result when using configuration caching #17659

Closed
cesar1000 opened this issue Jul 8, 2021 · 6 comments
Assignees
Labels
Milestone

Comments

@cesar1000
Copy link

Expected Behavior

I'd like to have the ability to acquire the build result from within my build when configuration caching is enabled. In particular, I'd like for build services to be able to acquire the build result at the time the build finishes (e.g. through a new interface, like Closeable, or a new finish event in OperationCompletionListener).

Current Behavior

Before configuration caching, builds would be able to add a BuildListener to the Gradle object to obtain the build's BuildResult. Configuration caching doesn't allow the use of build listeners, which makes it impossible to acquire build results.

Context

We have an error reporting plugin that monitors our builds for errors, presents a summary at the end of the build, and posts the error summary to our code review tool. After updating it for configuration caching, we've lost the ability to detect failures that happen outside of any tests – like compilation issues, failures during configuration, or failures to store the configuration cache. We haven't found and viable alternative.

@soloturn
Copy link

soloturn commented Jan 8, 2022

is this related so the build does not show a summary of the test cases executed any more ?

tasks.test {
  useJUnitPlatform()
  testLogging.showStandardStreams = true
  afterSuite(
    KotlinClosure2<TestDescriptor, TestResult, Unit>(
      { descriptor, result ->
        if (descriptor.parent == null) {
          logger.lifecycle("Tests run: ${result.testCount}, Failures: ${result.failedTestCount}, Skipped: ${result.skippedTestCount}")
        }
        Unit
      })
  )
}

@eskatos eskatos removed this from the 7.5 RC1 milestone Apr 5, 2022
@bamboo bamboo self-assigned this Jun 3, 2022
@bamboo bamboo added this to the 7.6 RC1 milestone Jun 3, 2022
@bamboo bamboo removed the to-triage label Jul 4, 2022
@eskatos
Copy link
Member

eskatos commented Aug 3, 2022

Related issue on the Kotlin Gradle Plugin side

@jonnycaley
Copy link

I wrote an article that uses build services to capture build information as an alternative to BuildListeners that you might find useful - https://proandroiddev.com/gradle-configuration-caching-replacing-a-build-listener-with-build-services-40bde11937f1

@bamboo
Copy link
Member

bamboo commented Feb 3, 2023

Hi @cesar1000, this public specification describes how we're planning to improve the situation in 8.1.
Let us know what you think.

@cesar1000
Copy link
Author

Thanks, @bamboo! I dropped a couple of questions in the doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

5 participants