-
Notifications
You must be signed in to change notification settings - Fork 81
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
Initial end-to-end test suite #178
Conversation
fba4052
to
8674cbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great improvement!
I don't think the amount of boilerplate we need for this will feel like too much once we've added more tests and as we've discussed offline, I even think parts of this could be extracted into a cram-test-like framework or upstreamed to an existing one!
I added a few minor comments but generally speaking it's 👍, thanks for your time on this!
bf94305
to
0f1f0ec
Compare
out of curiosity, did you consider using |
Looking good! Feel free to merge it whenever you think that's ready. That's a huge improvement over the current (empty) state. |
I hadn't but it's true we could make it work. I'm just not sure if that's a very good idea as it's a bit outside of I agree it wouldn't take much but I still think some features wouldn't quite fit. For instance, the random/non-deterministic output bits replacement logic we have here is quite different from what we want for What I had in mind was something simpler than mdx, focused on end to end testing for CLI binaries similar to what dune uses for its blackbox tests. I was actually hoping we could extract that into a tool which we could use in both We should probably also look into existing tools as there's probably one around! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Thank you very much for that, makes me want to contribute to alcotest
more!
I pointed a couple unnecessary %dep
in the dune rules but feel free to merge once they're fixed!
This is clearly off-topic, but |
0f1f0ec
to
14b620f
Compare
14b620f
to
c24bf79
Compare
This initialises an end-to-end test suite that compares example executions against expected outputs. The process is driven by auto-generated
dune
files, allowing a workflow ofdune runtest
→dune promote
.Currently this does not allow for passing options to the executable under test, which would be a nice addition. For this, we could use extra
*.opt
files similarly to how it's being done in OCamlformat.Frustrations
The
dune
action DSL has no way of negating the exit code of a command, so it's being done manually with a little script -- I might request this as a Dune feature...It's necessary to sanitize the output of the tests to remove environment dependencies / randomness. Again, this is being done by an extra script.
I initially added symlinks to the
examples/
directory to verify their output, but these appear to break the Windows CI, so I removed them.