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

Task 'runAffectedUnitTests' not found in root project #23

Closed
nhaarman opened this issue Nov 19, 2020 · 15 comments
Closed

Task 'runAffectedUnitTests' not found in root project #23

nhaarman opened this issue Nov 19, 2020 · 15 comments

Comments

@nhaarman
Copy link

Whenever I apply the plugin to a project and run the ./gradlew runAffectedUnitTests -Paffected_module_detector.enable command, I get the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'runAffectedUnitTests' not found in root project 'my-project'.

Running ./gradle tasks or ./gradlew tasks -Paffected_module_detector.enable results in no tasks added by this plugin either.

I have tried with multiple Android/Java only projects which all have different configurations, but all come up with the same results. I even copy pasted this entire block into the root build.gradle (thus having two buildscript blocks) to no success.

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "com.dropbox.affectedmoduledetector:affectedmoduledetector:0.1.0"
  }
}
apply plugin: "com.dropbox.affectedmoduledetector"
@digitalbuddha
Copy link
Contributor

hi @nhaarman apologies I never did a release due to wanting to move config block to be module specific. It should exist in the snapshot. I'm working on the improved config block right now and will have a full release today

@nhaarman
Copy link
Author

Ahh that explains! No worries!

@digitalbuddha
Copy link
Contributor

0.1.1-SNAPSHOT was just pushed, 0.1.2 will be out sometime tomorrow

@fabiocarballo
Copy link

@digitalbuddha did you end up publishing it? I couldn't find it.

@nhaarman
Copy link
Author

0.1.1-SNAPSHOT can be resolved for me, but it doesn't seem that ./gradlew runAffectedUnitTests -Paffected_module_detector.enable only runs affected unit tests, it runs all 🤔

@digitalbuddha
Copy link
Contributor

There should be a log file created. Could you verify that all modules were not affected during your execution? I have a free day tomorrow and will validate myself on the sample.

@nhaarman
Copy link
Author

I started a new project and added one library module. Applying the plugin and running the command results in only this in the logs 🤔 :

[INFO] [amd] Modules provided: null
[INFO] [amd] Using real detector

@digitalbuddha
Copy link
Contributor

I think my last change was racy, we've seen this before where the modules tasks did not exist before we ran our plugin task creation. Thanks for reporting I'll replicate and fix in am.

@digitalbuddha
Copy link
Contributor

need 1 more fix to land, I verified in the sample #27 both a non working behavior and now a working one. The issue was around short circuiting custom logic we had internally. I expect a review by end of week and will release new snapshot then. Thank you for bearing with us in the early days :-D

@nhaarman
Copy link
Author

No problem! If you need anything else let me know!

@digitalbuddha
Copy link
Contributor

new snapshot is up, will verify internally then do a real release

@nhaarman
Copy link
Author

nhaarman commented Dec 1, 2020

When I cloned the repository and published the snapshot locally, the plugin seemed to work on my real-life project!
(I couldn't get the published snapshot to work for some reason)

@digitalbuddha
Copy link
Contributor

Plugin publishing seems to escape my skill set. I'll keep at it! Thanks for feedback

@digitalbuddha
Copy link
Contributor

I forgot to chmod the release script, running now #29

@nhaarman
Copy link
Author

@digitalbuddha Will there be a release for these fixes?

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

No branches or pull requests

3 participants