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

variantToTest is not implemented #95

Closed
michaelcarrano opened this issue Dec 15, 2021 · 1 comment
Closed

variantToTest is not implemented #95

michaelcarrano opened this issue Dec 15, 2021 · 1 comment

Comments

@michaelcarrano
Copy link

I am playing around with this plugin and it seems like the variantToTest that is mentioned in the README isn't actually implemented.

affectedTestConfiguration{
   variantToTest = "debug" //default is debug
}

You can see variantToTest isn't defined in AffectedTestConfiguration. However, you can see an example of this in the sample app AffectedTasksPlugin

To reproduce, you can try adding variantToTest in one of the sample/build.gradle files such as https://github.com/dropbox/AffectedModuleDetector/blob/main/sample/sample-app/build.gradle#L8-L10. I actually run into a compile error when I try to build after adding variantToTest.

I am working on making changes so this works but so far, still only seeing the tests for debug variant running.

I changed the AffectedTestConfiguration to:

open class AffectedTestConfiguration {

    var variantToTest : String = "debug"
    var assembleAndroidTestTask : String? = "assemble${variantToTest.capitalize()}AndroidTest"
    var runAndroidTestTask : String?  = "connected${variantToTest.capitalize()}AndroidTest"
    var jvmTestTask : String? = "test${variantToTest.capitalize()}UnitTest"


    companion object {
        const val name = "affectedTestConfiguration"
    }
}

Any pointers? Would love to make a PR with the fix.

@chris-mitchell
Copy link
Contributor

Hi @michaelcarrano - oops, looks like the documentation and sample slipped with actual usage. I'll fix that shortly.

You should be able to use assembleAndroidTestTask, runAndroidTestTask and jvmTestTask to specify which tasks you want to run when the tests run for the given module.

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

2 participants