-
Notifications
You must be signed in to change notification settings - Fork 824
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
Make CLI integration tests automatically run the most up-to-date version of the CLI #4020
Conversation
b6ae1b9
to
9e42976
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get the motivation, and it seems reasonable.
However, this does seem to break a bunch of assumptions and workflows.
-
this makes us build the test CLI in a different manner than the "real CLI", because that is handled in the makefile, which could lead to drift in feature flags or various other compilation-affecting env vars/flags, which cause the integration to not exactly test the proper CLI
-
Related to the above: integratin-cli specific dependencies could lead to version drift between the shim and the full CLI, which could affect test results due to slightly changed behaviour. Image for example the integration cli using a higher but compatible version of a dependencies, which doesn't get unified for some reason or another. Not a problem if everything was a workspace dependency, and probably a somewhat theoretical concern, because the CLI doesn't usually use exact versions, but it could still happen
-
are there no tests exercising llvm at the moment? the feature is not enabled
-
As far as I understand, the full build currently also handles c api related building and packaing, which is required to succeed for all the build-exe related tests to pass, this hides that fact, and doesn't obviate the need for running
make
in order to get the tests to run properly
(note: I already suggested breaking out the build-exe tests into a separate step in the past, for somewhat related reasons) -
Prevents from running the API against a specific existing binary. no idea if that is useful
I'm tentatively in favour despite this, but I think we'll need to hear what @ptitSeb and @syrusakbary think, and if they are aware of any gotchas.
A lot of this can be mitigated by keeping the WASMER_PATH env var as an optional override, and only use the shim if it is not set.
|
||
# Enable optimizations for a few crates, even for debug builds. | ||
# | ||
# This greatly speeds up debug builds because these crates are extremely slow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is a bit confusing.
# This greatly speeds up debug builds because these crates are extremely slow | |
# This greatly improves runtime performance of debug builds, because these crates are extremely slow |
And yes, I'm perfectly aware who originally wrote that comment, so blame is on me.
@@ -65,9 +67,9 @@ fn wasmer_config_error() -> anyhow::Result<()> { | |||
.map(|s| s.trim().to_string()) | |||
.collect::<Vec<_>>(); | |||
#[cfg(not(windows))] | |||
let expected_1 = "Usage: wasmer config --bindir --cflags"; | |||
let expected_1 = "Usage: wasmer-cli-shim config --bindir --cflags"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing different command names opposed to the the proper wasmer
command would be somewhat confusing, wouldn't it?
Needs to be at least documented, maybe in the README.
Addendum: I think the CLI should keep using the This can be used to make local iteration easier regardless. |
Thanks for the input, @theduke! In retrospect, I'm thinking it might not be a good idea to proceed with this PR. The overall For now, I might just keep running my
Yeah, I guess we need to take a step back and ask what the integration tests are trying to achieve in the first place. Are they testing our compiler implementations, our WASIX implementation, CLI sub-command, or all of the above?
That's correct. We only run the integration test suite once, so CI only does integration tests against one compiler (I'm guessing cranelift?).
Good point. In the long term, I'd prefer to split the
I don't think I've ever had a concrete situation where I wanted this. It might be useful for a hypothetical WASIX spec test suite, but when you are wanting to test the CLI you'll always want to re-compile so you know what code is being tested. Footnotes
|
Something that always annoys me is that the CLI integration tests require you to remember to recompile the
wasmer
CLI in release mode every time you want to run the test suite. This tends to be quite a) error-prone and b) slow.I'm introducing a
wasmer-cli-shim
executable so we can use the$CARGO_BIN_EXE_<name>
environment variablecargo
sets when compiling integration tests. This will make sure we always run an up-to-date CLI executable becausewasmer-cli-shim
will be recompiled wheneverwasmer-cli
changes.As a happy side-effect, this means the old
run_unstable
tests no longer need to do their defensivecargo run --package=wasmer-cli
and can run thewasmer-cli-shim
executable directly.Fixes #4014.