-
Notifications
You must be signed in to change notification settings - Fork 46
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
Allow running non-deterministic MDX stanzas using dune-gen
#366
Allow running non-deterministic MDX stanzas using dune-gen
#366
Conversation
Thanks to @emillon for pointing out all the shortcut that dune allows to avoid declaring things over and over.
This should be more portable since we don't depend on `diff` being installed or have an exit code of 1 when the files differ.
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
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 to me!
This still needs a change on the dune side to declare the env var dependency right? At some point it would be nice to include dune stanza tests here as well so we're confident we don't break the compat with dune on those features!
That's a good point for the future. Unfortunately that would require us to use a dune version that has either 0.1 support or 0.2 support (the latter is dune 3.0 which is not released yet) unless we want to do a fun thing and declare:
|
CHANGES: #### Added - Add support for adding language tags and metadata labels in `mli` files. (realworldocaml/mdx#339, realworldocaml/mdx#357, @Julow, @Leonidas-from-XIV) - Add support for running non-deterministic tests in `dune` MDX 0.2 stanza by setting the `MDX_RUN_NON_DETERMINISTIC` environment variable. (realworldocaml/mdx#365, realworldocaml/mdx#366, @Leonidas-from-XIV)
That's done in ocaml/dune#5391. This only affects stanza 0.2 which is unreleased at the moment. |
That's a good point indeed. On the other hand I think that it wouldn't be too bad for MDX to require the version of dune that integrates well with it. We don't really offer good support for running MDX on your own anyway. We'd need to look into the implications more carefully but on principle, I think it could work. |
We can also test this by doing what the stanza does by hand, ie something like that in a cram test:
It's an e2e test of dune-gen, not of the dune stanza, but this ensures that this contract works. |
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
Since realworldocaml/mdx#366, the executable output by `ocaml-mdx dune-gen` supports `MDX_RUN_NON_DETERMINISTIC` like `ocaml-mdx test` itself. Dune needs to know about that to rerun the tests if the variable has been set in the meantime. Signed-off-by: Etienne Millon <[email protected]>
There is a number of ways this could be implemented, but for simplicity this just uses the same environment variable as the main executable, but to avoid dependencies it doesn't use the Cmdliner flag.
Closes #365.