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

Improve how we detect tests #1618

Merged
merged 1 commit into from Nov 14, 2019
Merged

Improve how we detect tests #1618

merged 1 commit into from Nov 14, 2019

Conversation

pyricau
Copy link
Member

@pyricau pyricau commented Nov 14, 2019

Fixes #1552

@pyricau pyricau merged commit f39bea8 into master Nov 14, 2019
@pyricau pyricau deleted the py/detect_tests branch November 14, 2019 23:42
@Armaxis
Copy link
Member

Armaxis commented Nov 15, 2019

Does the new solution cover both unit tests and instrumentation tests? It detects junit class, is that one available in instrumentations too?

@pyricau
Copy link
Member Author

pyricau commented Nov 15, 2019

Yep, instrumentation tests are built on top of junit.

@@ -46,6 +44,13 @@ internal object InternalLeakCanary : (Application) -> Unit, OnObjectRetainedList
var applicationVisible = false
private set

private val isJunitAvailable = try {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this val eagerly calculated (i.e before the Handler post called below) since it does not use get() = syntax?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, this should be a lazy.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR that fixes it: #1629

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. So quick 👊

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

Successfully merging this pull request may close these issues.

how to force opt out the leakCanary in the test with LeakCanary 2?
3 participants