AffectedModuleDetector icon indicating copy to clipboard operation
AffectedModuleDetector copied to clipboard

Help debugging why unnecessary tasks are running

Open davidalbers opened this issue 1 year ago • 4 comments

Hi 👋

I've setup AMD in my project and created a custom task to run unit tests for a specific flavor:

    customTasks = [
            new AffectedModuleConfiguration.CustomTask(
                    "runAffectedStagingDebugUnitTests",
                    "testStagingDebugUnitTest",
                    "Run Affected Staging Debug Unit Tests"
            )
    ]

When I run

./gradle runAffectedStagingDebugUnitTests -Paffected_module_detector.enable

As expected, the unitTest task only runs on affected modules, example log output:

...
> Task  :some:affected:module:testStagingDebugUnitTest
...
... test output
...
> Task :some:unaffected:module:testStagingDebugUnitTest SKIPPED

However, I still see some dependent tasks from the unaffected modules still running and contributing to the build time:

...
> Task :some:unaffected:module:preStagingDebugUnitTestBuild
> Task :some:unaffected:module:checkStagingDebugUnitTestAarMetadata
...

Since these are dependencies for :some:unaffected:module:testStagingDebugUnitTest I'd expect them not to run. Is that right? Do you have any ideas how I can debug what's going on?

davidalbers avatar May 25 '23 18:05 davidalbers