-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
binaries built by cargo test
can be different from those built with cargo build
#11954
Comments
This is expected behavior for cargo and is important for integration tests to do end-to-end testing of the binaries. btw something that would be useful in an issue like this is to focus on the negative impact on the behavior. This issue does not say why this is bad and should change. |
After our project is built, the cargo test is executed for preliminary verification. However, because I have enabled different features in dev-dependencies, I am troubled by why the binary functions are inconsistent with my actual expectations when I use debug binary to verify functions in the development environment. |
I didn't know that |
Feature unification is a "global" stuff. It unifies features across each Cargo target. From my point of view the purpose of it is to reuse as many build artifacts as possible. If you want to avoid this behavior, you maybe remove activated features from that dev-dependency. Set those features in |
Reuse is a good thing, but I think the premise of reuse is that you shouldn't modify the original finished product. |
cargo test
can be different from those built with cargo build
Problem
When the cargo test is executed, the binary built by the cargo build is overwritten as the result of the cargo test build.
test-build.zip
Steps
Binaries will be overwritten constantly.
Possible Solution(s)
The cargo test should not modify the bin, but only the compiled test bin.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: