Skip to content
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

testing warnings #125

Merged
merged 2 commits into from
Sep 14, 2023
Merged

testing warnings #125

merged 2 commits into from
Sep 14, 2023

Conversation

n-osborne
Copy link
Collaborator

@n-osborne n-osborne commented Sep 11, 2023

This PR add some test for the warning system of the ortac-qcheck-stm plugin.

  • A diff test to test the warnings of level warning (each function of the module raising a different warning).
  • A cram test to test the warnings of level error

@n-osborne n-osborne force-pushed the testing-warnings branch 5 times, most recently from be2b4ed to 9556104 Compare September 13, 2023 14:55
Copy link
Contributor

@shym shym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test suite, congratulations! 🎉
Unfortunately, this reveals that there is some work left on cleaning up those error messages... 🙈
I have mostly suggestions about the dune configuration, to bring it on line with the other tests.

@@ -1,3 +1,6 @@
(cram
(deps %{bin:ortac}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should take the complete set of dependencies (package ...) as other tests and be attached to the qcheck-stm package.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github CI is indeed complaining when trying to install the packages.

plugins/qcheck-stm/test/dune Outdated Show resolved Hide resolved
plugins/qcheck-stm/test/dune Outdated Show resolved Hide resolved
plugins/qcheck-stm/test/dune Outdated Show resolved Hide resolved
(target testing_warnings_errors)
(package ortac-qcheck-stm)
(deps
(package ortac-core)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should reuse the same set of dependencies and the setenv setting in the action than other tests.

plugins/qcheck-stm/test/testing_warnings.ml Outdated Show resolved Hide resolved
@n-osborne
Copy link
Collaborator Author

Thanks for this review.
I've updated the PR accrodingly.

Only the warnings of level warning (and not error) are tested in this
commit. The generated `.ml` file is ignored because it does not contain
relevant information and the OCaml compiler would complain about it.
The cram test tries to be progressive so it can also be used as
documentation.
@shym
Copy link
Contributor

shym commented Sep 14, 2023

As it is really a quibble, I just overwrote your branch with a small difference (pushing the addition of the cram stanza entirely to the second commit).
Otherwise, this is good to go!

@shym shym merged commit 04e22ab into ocaml-gospel:main Sep 14, 2023
1 of 2 checks passed
@shym
Copy link
Contributor

shym commented Sep 14, 2023

CI is happy so I merged it.
Thanks!

@n-osborne n-osborne deleted the testing-warnings branch September 18, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants