-
Notifications
You must be signed in to change notification settings - Fork 181
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: Split test string #2789
Comments
|
Given:
, is the complexity I'm pointing out a problem that arises because of such non-conformity, and adopting a more conventional approach would naturally resolve it? Or does it appear to you that our "unconventional" testing approach is out of necessity? Alternatively, I'm wondering if your comment is moreso an observation on our extensive use of regression testing rather than unit testing? Just picking at your brain to see if there's a logical & efficient way to change our tests across the board. |
For our usecase, I think that our tests are fairly suitable especially since they emulate how an end user would use the tools that we develop. I think the "peculiarity" of our testing framework is mainly due to the use of bash scripts (which is sort of made necessary due to our commands workflow). I was just pointing out that because of this, I don't know about the existence of guidelines and best practices that are commonly used in this scenario.
On this point, I don't think that unit testing and integration/approval testing are mutually exclusive. In an ideal scenario, we would have both. For example, an obvious limitation of our test suite is that we don't test any GUI code. This is because there is not obvious way of running
I've thought about this when I was shifting the build system to CMake. I think for example, we could probably provide the delineation between the "types" of operation in a bash command by delegating the running of commands to designated bash functions (similarly to the Github project I linked above). This would allow for better error messages and a more structured way of writing tests. The downside would be that our bash tests would (slightly) distance themselves from how users use mrtrix in practice, so I'm not sure this would be worth it. However, I do think there are few low-hanging fruits that we can pick. One of them would be that our tests don't have any description or even a name. It's very difficult to understand what exactly a test is doing and why a certain output is expected. I think we should at least provide comments for each test to improve this (or some other mechanism like a custom bash function), so that a reader doesn't need to know the exact mechanics of each command to be able to understand what's going on. |
Yes, the absence of labels for the tests is something I have been thinking about in this context that I didn't state in the OP. I've tried adding comments in some test bash script files, but particularly now using So to be clear, what I'm proposing is to change from:
to something like:
|
One other factor here is that when CI tests were first introduced, we struggled to get them running within the timeframe afforded by the CI service. As such, there are a number of tests where there is a conversion step done inline as part of one of the initial tests, and the result of such is re-used by later tests. Since then, not only are CI resources typically beefier, but also |
Rather than each test having to manually specify its own cleanup, could instead have |
Currently, there are quite a few tests where a single test string actually contains:
(partly to reduce storage space of the test data, partly to make the nature of the test data self-explanatory)
Questions primarily for @daljit46:
ctest
"classify" lines based on which of the three categories each belongs to?The text was updated successfully, but these errors were encountered: