Leo CLI tests should be tested on Linux and Windows not just MacOS
Currently, we only run Leo CLI tests on MacOS. The tests are skipped for Linux and Windows. At the very least, we should extend coverage to Linux. I suspect extending to Windows is a bit more involved but would be useful nonetheless since we claim Windows support.
Also, we need to also test against leo devnode in the same way we test against leo devnet.
While trying to run REWRITE_EXPECTATIONS=1 cargo test -- integration_tests as part of #29020, no artifacts were generated in https://github.com/ProvableHQ/leo/tree/mainnet/tests/expectations/cli as I was expecting so did some digging.
Turns out there is a macOS-only check is in the source code (leo/tests/integration.rs:186-189):
if !cfg!(target_os = "macos") {
println!("Skipping CLI integration tests (they only run on macos).");
return;
}
It seems this was originally intended because snarkOS is only installed on the macOS runner (probably to save CI time), which is needed for the tests. However, this means testing can also only be run locally on macOS machines as well.
The fix should be:
- Remove the platform check from source code - let devs run tests locally on any platform if they have snarkOS installed
- Keep the CI optimization in CI config - if we only want to run CLI integration tests on macOS to save resources, filter the test there (e.g., only run integration_tests in the macOS job)
This way local development isn't artificially restricted.
Yeah this restriction is a pain. There is a chance that @Roee-87 has a commit somewhere that already addresses this. Is that the case Roy? Or should @JoshuaBatty take this on?
Hi @Roee-87! Any chance you have an update on this? I daily drive Linux, and have been commenting out this condition everytime I run the tests ๐ The tests seem to work fine on Linux - perhaps we can change the condition to at least support Unix for now? Edit: I might just do up a quick PR for this this afternoon.
The tests seem to work fine on Linux - perhaps we can change the condition to at least support Unix for now?
Addressed in #29032.