Migrate tests to cram #330
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This migrates the test suite from using a custom script to using dune's cram test, effectively re-enabling the test suite in opam.
This makes our test a bit more standard and easier to understand for new contributors. It also keeps all of a test relevant information in a single file: the data, the parameters, the commands being run, it's all in one place and very straightforward to read and understand and use the standard dune promotion workflow.
I took extra care in porting the failing tests as we used to generate an html report to highlight the diffs. In those I run ocp-indent and compare the output with the expected formatting to highlight the specific bits we know we don't handle as intended. I also added a README describing this in the
tests/failing/folder.A good follow up to this would be to split some of the tests into smaller bits so that the input and output leave closer together in the cram files. A lot of the test were written in large files with multiple test cases. We could keep the same file structure but test each individual case one after the other. For now I sticked to the same granularity, ocp-indent is called on the exact same files as before.