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

Support live visualizations with Tyche, via the OpenPBTStats log format? #604

Open
Zac-HD opened this issue Nov 9, 2024 · 4 comments
Open

Comments

@Zac-HD
Copy link

Zac-HD commented Nov 9, 2024

Tyche is a VS Code extension designed to help users understand what their property-based tests are doing - with nice features like live-updating graphs, and lots of explorable raw data if you want to dig deeper. I've been collaborating with the author since late last year (as a Hypothesis maintainer), as described in our paper. Notably, this helped us find several performance problems and outright bugs in Hypothesis itself, as well as being useful for our users.

But the reason I'm opening this issue is that Tyche is not Hypothesis-specific; it's instead based on a simple json-lines format which could be emitted from any PBT library and consumed by a wide variety of tools. If you want to support it from jqwik, emitting the type, run_start, property, status, and representation is enough to enable a substantial portion of Tyche’s features.

@jlink
Copy link
Collaborator

jlink commented Nov 9, 2024

@Zac-HD Thats definitely interesting. I'll have a look at the format. Does the VS Code integration require anything else than emitting json lines?

@Zac-HD
Copy link
Author

Zac-HD commented Nov 9, 2024

Nope - the Tyche editor plugin watches known directories for the jsonlines file, and everything from there is automatic. Users can configure which directory that is, but @hgoldstein95 tends to add support for new locations so they mostly won't even need to do that 😁

@jlink
Copy link
Collaborator

jlink commented Nov 12, 2024

@Zac-HD Is there a showcase project where I could see how Tyche looks with hypothesis? I need something cool to motivate me :-)

@Zac-HD
Copy link
Author

Zac-HD commented Nov 12, 2024

image

and of course you can click in to any of these slices to see each test-case by category; load the data up into datasette or pandas and explore it that way, etc.

I don't have a demo project, the whole point is that it works with any test suite, but https://github.com/python-jsonschema/hypothesis-jsonschema is a nice size to explore and has many property-based tests if you want to try it out?

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

No branches or pull requests

2 participants