Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Include the test class in the Description #61

Open
dimo414 opened this issue Nov 1, 2019 · 3 comments
Open

Include the test class in the Description #61

dimo414 opened this issue Nov 1, 2019 · 3 comments

Comments

@dimo414
Copy link

dimo414 commented Nov 1, 2019

I'm trying to design a JUnit4 Rule and have run into an issue with tests using Burst, because the Description passed to my rule returns null from getTestClass().

It looks like this line is the source of the Description in question, as it passes a custom string instead of a className.

Would Burst be open to fixing this? Something like:

return Description.createTestDescription(
    getTestClass().getJavaClass(),
    getName() + ":" + method.getName(),
    method.getAnnotations());

Is sufficient for my use case, though it does change the result of Description.getDisplayName(). If that works I'm happy to send a PR, otherwise are there other approaches you might be open to?

@JakeWharton
Copy link
Collaborator

I think this is probably fine, but it's been so long the nuances of descriptions are definitely lost on me. The only real concern, I think, is the effect on the IDE experience.

@dimo414
Copy link
Author

dimo414 commented Nov 1, 2019

Yeah, I'm not sure if there's a specific format for the second argument that would be most-correct, but seeing as nothing's blown up with the malformed className I'd hope IDEs can handle a change like this? 🤞

@saket
Copy link

saket commented Oct 21, 2020

Turns out this bug is also restricting paparazzi from working with burst.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants