Open mseri opened 11 months ago
Currently mdx depends on the compiler internals and, as it is, mdx will also require updates to work with OCaml 5.2, so this problem is going to repeat soon.
I would personally recommend to
simplify / drop features from mdx to make it mostly independent of the compiler internals, and
stop using mdx as a critical testing tool and only use it to optionally check documentation.
Thanks for the comment. Ping @talex5
I support your first point. I think for the latter is too late, since many projects are now using mdx to use the documentation also as a testing tool
The mdx tool, as it is, requires constant maintenance to keep up with the compiler internals and mdx is not, to my knowledge, currently actively maintained. Perhaps this changes in the future, but for now I personally do not recommend using mdx as a testing tool.
As long as software is being maintained, it should not be too late to rewrite tests to use less fragile and maintenance heavy approaches.
PR on opam-repository is at https://github.com/ocaml/opam-repository/pull/24535
To comment on
stop using mdx as a critical testing tool and only use it to optionally check documentation.
Now that Dune supports cram test and that cram test support has been removed from mdx, the tool's primary purpose is indeed to run code blocks in documentation, and not to be a test runner.
I've been curious about that: is there anything blocking Eio from using Dune cram tests in place of mdx?
Eio will always have documentation, so it always needs to depend on a doc tester like mdx. So having a second testing system doesn't make things any more reliable, and cram tests look less convenient that mdx. What's the benefit?
To comment on
stop using mdx as a critical testing tool and only use it to optionally check documentation.
Now that Dune supports cram test and that cram test support has been removed from mdx, the tool's primary purpose is indeed to run code blocks in documentation, and not to be a test runner.
What is confusing in my opinion is craml is marked as deprecated and I'm directed to use mdx instead. The cram tests documentation for dune doesn't mention any deprecation, I can only assume because it uses something else? But it's not clear whether it is.
I can create the equivalent documentation tests in mdx and they work the same as the dune cram tests.
So which supported option should I use to test cli ocaml programs?
@tmcgilchrist As someone who is new and just finally stumbled to this issue and comment. I agree. I was quite confused and thought I should be using mdx
only to find out that craml
is not deprecated and is in fact part of dune
Would it be possible to have a release of mdx with https://github.com/realworldocaml/mdx/pull/435 ? This would re-enable testing for a number of packages that where otherwise failing (and now are not tested due to newly introced upper bounds, see https://github.com/ocaml/opam-repository/pull/24467)