-
Notifications
You must be signed in to change notification settings - Fork 18
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 alternative file loaders #218
Comments
Similar to #217, this is solution focused. Let's list out the use cases you are trying to solve with this solution so we can evaluate what the right solutions are for this. |
My over-arching use case is:
Random ideas on the top of my mind - some of these probably have existing open issues:
(I'm not formally proposing these - they are just ideas.) My point is there are infinite possibilities to define / extend the test definition format. I'm likely not going to convince |
Most of that wouldn't work with just manual construction (#217) or alternative file loaders (this issue) but tie into all of the behavior of trycmd. For some For Matching is built directly in, so any changes there would require major re-works.
I hope the above showed why concrete cases are needed rather than infinite possibilities. Flexible code is hard to write and maintain and usually is extended in the wrong direction. We need a concrete idea of what extensions are needed. |
(Filing this issue in response to discussion on #214.)
I frequently find myself brushing up against limitations in the file formats that
trycmd
currently supports. (I am one of the top historical contributors to Mercurial, whose expressive.t
test format / harness was the inspiration for cram. cram exposes a subset of what Mercurial's.t
format supports (for better or for worse). Andtrycmd
a subset of cram's. So from my perspective the feature set oftrycmd
is somewhat limited.)It seems I'm not alone. Scanning the issue tracker for this project reveals a handful of other users wanting extensions to the file format.
I'd like to propose a new feature (which I initially proposed in #214): support for custom file loaders. The way it works today is
trycmd
is the lone arbiter deciding how tests are defined and loaded from files. My idea is to provide an API that allows customers to bring their own file formats / loaders. This requires opening up theTryCmd
struct to the public API (#217).If customers are able to define their own file formats, they are able to experiment with extensions to the current file format or completely different file formats entirely. All while reusing the internals of
trycmd
to run tests. This could lead to a world where people proposing new file format features are encouraged to experiment on their own projects first before coming back to this project with a clear demonstration of value to justify inclusion in the official file format.As a tangible example of this, using
trycmd
with my patches from #214, I built a custom test runner that supports running.trycmd
tests from a filesystem sandbox of the crate root - something not possible with.trycmd
tests using the public API available today. This only scratches the potential of what's possible.The text was updated successfully, but these errors were encountered: