test: fix meson test() executable definitions#333
Conversation
|
The Is there a preferred approach there? Should these tests be able to be be run on arbitrary CI, or should we remove the |
|
When we initially added the tests to the test target, the assumption was these tests are able to run as standalone tests. But most of these tests they are written to run against real hardware. I was playing with some ideas how to improve the testing. One thing I'd like to change is to move the tests which run against real hardware into it's own target. So that the So in short, yes, I agree with you we should drop the hardware tests from the |
|
BTW, the Python tests are fine as unit tests. These just test if the Python is able to load the binding. |
Currently, the tests under test/ require intractions with actual hardware, which isn't available under CI. [Additionally, the test() functions are mostly incorrect, as they'll all just repeat the same test.c test] This test drops the test() defitinitons, but leaves the executable()s available for developer use, and adds a comment to indicate what we're doing. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
|
OK, so if I'm understanding things correctly: we should drop the tests that require actual hardware from the test target; sounds reasonable. This will make the coverage reports somewhat worse though :) And yes, I'll leave the python tests as-is. Updated branch coming soon. |
|
Yes, the coverage tests look a bit sad indeed. This is something we should improve. Haven't really figured out what the best strategy here is. I welcome any input :) |
|
I'm writing a few tests for the NVMe-MI branch now, which don't require hardware. Those just have a fake test transport for the actual communication with the device, which can respond according to the test's requirements. We could do something similar for the MI core, where we have a fake I'll push the new |
|
Cool, looking forward to your update. As previously sad, I haven't really looked into the details yet but I agree if we can get a simple environment setup for testing then let's try to get this working. For fully end-to-end test with nvme-cli we could harness blktests as @ChaitanayaKulkarni has suggested. |
|
OK, done - the test-related change is up at e43e644 |
If tests are potentially destructive, then it makes sense to not run them in the default testing target. On the other hand, if there are non-destructive tests which nevertheless need to run on real hardware -- maybe the solution is to just teach the tests to emit a SKIP status: https://mesonbuild.com/Unit-tests.html#skipped-tests-and-hard-errors Then the tests still run, and people with real hardware can get a complete view of the test status, but if you don't have the hardware everything still passes but with an informational "some tests were skipped" effect. |
Currently, all of the meson tests are defined to just run the single
main test.
Instead, we should be defining each of the tests to use the appropriate
executable().
Signed-off-by: Jeremy Kerr jk@codeconstruct.com.au