The main reason why I hadn’t added both (for the existence of the expect/inline extension @lukstafi is to blame extensions to the Platform extension was because it is written in OCaml and I haven’t had any experience in writing VS Code extensions or OCaml for JS/Node (and not much writing OCaml, I’m just trying it now because of multicore and effects), so I thought I could at least use the ‘native’ language for extensions to make the process a bit easier and faster.
It’s funny you’re mentioning that the reason for not contributing was that you didn’t have enough experience with OCaml: one of the motivations for writing the extension in OCaml is that we thought we’d have more community contributors if the code was written in OCaml!
That being said, if you’re interested in contributing but the barrier to doing so was too high, don’t hesitate to ask questions on the issue tracker. I’m also happy to help, feel free to reach out at thibaut.mattio@gmail.com.
Last but not least the biggest problem of the Alcotest extension (inline - Alcotest and JS - and expect tests are sufficiently unique) is finding the test cases reliably in the source, which should be easier being able to use existing OCaml libraries, I guess. Porting the extensions to OCaml and integrating them into the Platform should be quite straightforward.
I’m not aware of libraries that would make the integration easier, but it would certainly be interesting to explore how we could make Dune aware of the tests, it would make it possible to run a single test easily from the command line (e.g. dune test my_test.ml:54
, see running a single inline test · Issue #4873 · ocaml/dune · GitHub) and expose them from Dune RPC for consumption from the editor extensions. cc @emillon who’s been thinking about this I think.
Porting the extensions to OCaml and integrating them into the Platform should be quite straightforward. But as the weather is getting warmer, the snow melts and the days are getting longer I’m getting less inclined to spending much of my spare time in front of the computer too.
Completely understandable! Again, you’re more than welcome to contribute, and I’m happy to help with any blocker you have - but otherwise, we’ll probably explore adding the support for a test explorer at some point, and will let you know when that happens.
Regardless, your work on this is really appreciated, and I have to say I’m rather impressed that the first thing you do while trying OCaml 5 is identify missing features in the VSCode extension and take it on you to build new extensions! Thank you