-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Track coverage information #437
Comments
How would you want to export coverage reports? I'm not entirely opposed to it, but this sounds like a niche feature unless there is some really good tooling that this could plug into. |
My end goal would be to send that coverage to codecov. I haven't really looked up what the best output format would be It is indeed probably a niche feature, so maybe a good way for me to able to achieve this would be to expose enough internals (under the |
Yeah, |
In my project, I've been trying to make sure my templates rendering won't crash at runtime by generating a bunch of sample contexts and render my templates with them in my tests.
One thing I would really be interested in having would be coverage informations for them. I would like to know how much my sample contexts cover all possible branches in my templates.
Thankfully, minijinja being really nicely designed, it seems to already track source spans in the instructions, so it feels like it should mainly be a matter of emitting the spans during instruction evaluation, similar to what is done for the fuel tracker.
I'd be happy to prototype something if you think this feature makes sense. This could be done either by doing coverage tracking within minijinja, or by exposing more internals (looks like exposing a way to read
Template.instructions
should be enough?) and adding a hook/callback when instructions get evaluated.The text was updated successfully, but these errors were encountered: