cabal check testuite: add sanity checks#8248
Conversation
cabal check testuite: add sanity checks
aa717f3 to
8bad4c1
Compare
jneira
left a comment
There was a problem hiding this comment.
Amazing work, to improve the test suite and coverage is one of the most valuables contributions to any codebase and cabal of course. Many thanks.
|
I wonder if hardcoding error messages in the test suite is really necessary, or a more flexible check (pun intended) that there is a warning (or that exit code is non zero) would suffice. The latter would be easier to maintain probably. |
|
The question is sound, thanks for bringing it up. If you test on the mere presence of errors/warnings (without comparing error messages):
I wrote tests checking against output:
The question is even more sound considering how I am approaching writing tests for Tests are indeed not cheap to maintain, any kind of direction on what maintainers are happy with is welcome. CC @andreasabel who mentors me and is for sure interested. |
|
well I think messages don't change so frequently and fix the test in front of no semantic changes is almost trivial: you get the test error and change the message there are not unit tests for Chech messages, I want to remember there were some but not sure. Maybe the correct balance between unit and integration tests could make msintanence more lightweight |
8bad4c1 to
9581b46
Compare
|
@ulysses4ever a consideration on tests maintainability. My plan to reimplement Once that is done there should be a way to convert the testsuite from checking against Current testsuite would still be useful in refactoring I cannot promise a timeframe because my plate is quite full, but ideally I think checking against constructors will give us maintainability and precision at the same time. |
|
@ffaf1 sounds good. Being able to check type constructors sounds exciting! But I understand everyone is busy and don't hold my breath.
That is true. I thought about cases when you have to change many/all tests in bulk because e.g. the format of messages changed. Or when you have the same message in many tests. But maybe this is unlikely to happen. |
No body: No executables, libraries, tests, or benchmarks found.
Executables can have the same name as the external library.
Internal libraries cannot have the same name as the pacakge.
`signatures` field can be used only with `cabal-version` ≥ 2.0
All in `autogen-modules` has to be present either in `other-modules` or `exposed-modules`.
All in `autogen-includes` hs to be in either `includes` or `install-includes`.
`main-is` has to be one of: .hs, .lhs, C/C++/obj-C source file.
You need `cabal-version` ≥ 1.18 to use C/C++/obj-C source files in `main-is`.
All in `autogen-includes` hs to be in either `includes` or `install-includes`.
All in `autogen-modules` has to be present either in `other-modules` or `exposed-modules`.
`main-is` has to be one of: .hs, .lhs, C/C++/obj-C source file. (testsuite)
You need `cabal-version` ≥ 1.18 to use C/C++/obj-C source files in `main-is`. (testsuite)
All in `autogen-includes` hs to be in either `includes` or `install-includes` (testsuite).
All in `autogen-modules` has to be present either in `other-modules` or `exposed-modules` (testsuite).
`main-is` has to be one of: .hs, .lhs, C/C++/obj-C source file. (benchmark)
All in `autogen-modules` has to be present either in `other-modules` or `exposed-modules` (benchmark).
All in `autogen-includes` hs to be in either `includes` or `install-includes` (benchmark).
9581b46 to
156fb34
Compare
|
I'm not sure whether it's best to merge 22 commits individually or squash them. It seems they have been merged individually. I think I'd prefer squashing (in the future, at least). |
|
Ouch, I will do that next PR! |
|
It's in a clearly separate loop of the git history, so not much harm (visible, e.g., with gitk). |
cabal checktestsuite: sanity checks (i.e.: this bit).Missing:
cabal checkis cruft #8247)main-ismissing fromtest-suite#8246)Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!