Skip to content

Conversation

@aothms
Copy link
Collaborator

@aothms aothms commented Dec 3, 2025

This PR adds a utility script to trace gherkin execution for the given steps. Code quality is very low, for which I blame Altman.

GEM011_Consistententitytypesused11_fail-gem011-scenario01-composite_curve_inconsistent_types ifc dot
python .\util\scripts\render_dot.py .\features\rules\GEM\GEM011_Curve-segments-consistency.feature --define input=.\test\files\GEM\gem011\fail-gem011-scenario01-composite_curve_inconsistent_types.ifc

expands to

python -m behave --no-capture -v .\features\rules\GEM\GEM011_Curve-segments-consistency.feature --define input=.\test\files\GEM\gem011\fail-gem011-scenario01-composite_curve_inconsistent_types.ifc

Add -v (verbose) which will render context.instances after each given step to stdout, picked up by this script and then written to Graphviz .dot file (make sure dot exists in path render out to .png)

@aothms aothms requested review from Ghesselink and civilx64 December 3, 2025 13:13
@Ghesselink
Copy link
Contributor

Really nice. Took me a little bit to get it working locally, but managed to run it for GEM004 as well.
GEM004_TopologyRepresentationTypemustbevalid_fail-gem004-ifc4x3-solid_as_topology_representation_type ifc dot

With which use-case in mind did you make this?

Code quality is very low, for which I blame Altman.

Hehe, for a preview it's fine I guess. It would be nice to:

  • Add the Then steps
  • Visualize the error-generating 'paths' (e.g. colour the line red)
  • Offer it as an additional report on the VS-platform (only on request I'd say, if we run it on every upload we need to get a lot more storage ..)
  • Add it to the rule catalog / the gherkin repo.

What do you think? I can imagine this would be helpful for some vendors

@aothms
Copy link
Collaborator Author

aothms commented Dec 4, 2025

Add the Then steps + Visualize the error-generating 'paths' (e.g. colour the line red)

I think that's a great idea, potentially a bit complex with the depth options and all. There are also some given steps with depth btw like the elements pairwise at depth x (iirc) that might also break the rendering currently. But it should be possible to take the boxes (clusters in graphviz) at a certain depth and draw from that again.

For now I just started this with the idea of our own internal inspections. Especially also when the quarantine process really kicks in. And maybe we can add an example image to the README to give people a better understanding of our execution model.

I guess the compressed .dot files wouldn't take a lot of space: 4.6K * 193 scenarios (grep -R --include='*.feature' -i scenario | wc -l) is under 1M per upload. But for now I would keep it internally.

If you have an appetite for refining it, I'd be grateful :)

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.

3 participants