{"action":"created","issue":{"url":"https://api.github.com/repos/square/leakcanary/issues/1552","repository_url":"https://api.github.com/repos/square/leakcanary","labels_url":"https://api.github.com/repos/square/leakcanary/issues/1552/labels{/name}","comments_url":"https://api.github.com/repos/square/leakcanary/issues/1552/comments","events_url":"https://api.github.com/repos/square/leakcanary/issues/1552/events","html_url":"https://github.com/square/leakcanary/issues/1552","id":485284174,"node_id":"MDU6SXNzdWU0ODUyODQxNzQ=","number":1552,"title":"how to force opt out the leakCanary in the test with LeakCanary 2?","user":{"login":"lannyf77","id":19765258,"node_id":"MDQ6VXNlcjE5NzY1MjU4","avatar_url":"https://avatars2.githubusercontent.com/u/19765258?v=4","gravatar_id":"","url":"https://api.github.com/users/lannyf77","html_url":"https://github.com/lannyf77","followers_url":"https://api.github.com/users/lannyf77/followers","following_url":"https://api.github.com/users/lannyf77/following{/other_user}","gists_url":"https://api.github.com/users/lannyf77/gists{/gist_id}","starred_url":"https://api.github.com/users/lannyf77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lannyf77/subscriptions","organizations_url":"https://api.github.com/users/lannyf77/orgs","repos_url":"https://api.github.com/users/lannyf77/repos","events_url":"https://api.github.com/users/lannyf77/events{/privacy}","received_events_url":"https://api.github.com/users/lannyf77/received_events","type":"User","site_admin":false},"labels":[{"id":238439652,"node_id":"MDU6TGFiZWwyMzg0Mzk2NTI=","url":"https://api.github.com/repos/square/leakcanary/labels/type:%20documentation","name":"type: documentation","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2019-08-26T15:01:45Z","updated_at":"2019-11-13T19:45:48Z","closed_at":null,"author_association":"NONE","body":"https://square.github.io/leakcanary/upgrading-to-leakcanary-2.0/\r\nsays now it does not have leakcanary-android-no-op but only:\r\n```\r\ndependencies {\r\n  debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-3'\r\n}\r\n```\r\n\r\nin our app with 1.6.3 we have \r\n\r\n```\r\n//leakcanary\r\ndeps.leakcanary = \"com.squareup.leakcanary:leakcanary-android:1.6.3\"\r\ndeps.leakcanary_no_op = \"com.squareup.leakcanary:leakcanary-android-no-op:1.6.3\"\r\n```\r\nand would like to not run leakCanary in the test\r\n\r\n```\r\nconfigurations.all { config ->\r\n   \r\n    // Ensure the no-op dependency is always used in JVM tests.\r\n    if (config.name.contains('UnitTest') || config.name.contains('AndroidTest')) {\r\n        config.resolutionStrategy.eachDependency { details ->\r\n            if (details.requested.group == 'com.squareup.leakcanary' && details.requested.name == 'leakcanary-android') {\r\n                details.useTarget(group: details.requested.group, name: 'leakcanary-android-no-op', version: details.requested.version)\r\n            }\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n```\r\ndependencies {\r\n    debugImplementation deps.leakcanary\r\n    releaseImplementation deps.leakcanary_no_op\r\n    testImplementation(deps.leakcanary_no_op) {\r\n        force = true\r\n    }\r\n    androidTestImplementation(deps.leakcanary_no_op) {\r\n        force = true\r\n    }\r\n}\r\n```\r\n\r\nnow with LeakCanary 2,   how to force opt out the leakCanary for the test?\r\n"},"comment":{"url":"https://api.github.com/repos/square/leakcanary/issues/comments/553570598","html_url":"https://github.com/square/leakcanary/issues/1552#issuecomment-553570598","issue_url":"https://api.github.com/repos/square/leakcanary/issues/1552","id":553570598,"node_id":"MDEyOklzc3VlQ29tbWVudDU1MzU3MDU5OA==","user":{"login":"pyricau","id":557033,"node_id":"MDQ6VXNlcjU1NzAzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/557033?v=4","gravatar_id":"","url":"https://api.github.com/users/pyricau","html_url":"https://github.com/pyricau","followers_url":"https://api.github.com/users/pyricau/followers","following_url":"https://api.github.com/users/pyricau/following{/other_user}","gists_url":"https://api.github.com/users/pyricau/gists{/gist_id}","starred_url":"https://api.github.com/users/pyricau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyricau/subscriptions","organizations_url":"https://api.github.com/users/pyricau/orgs","repos_url":"https://api.github.com/users/pyricau/repos","events_url":"https://api.github.com/users/pyricau/events{/privacy}","received_events_url":"https://api.github.com/users/pyricau/received_events","type":"User","site_admin":false},"created_at":"2019-11-13T19:45:48Z","updated_at":"2019-11-13T19:45:48Z","author_association":"MEMBER","body":"Suggestion from @vRallev (based on our codebase) : we could look for `\"org.junit.Test\"` and disable leakcanary when found."}}
{"actor":{"display_login":"pyricau"}}