-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Allow to skip test code during publishing #4389
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
src/cargo/util/toml/targets.rs
Outdated
@@ -38,19 +39,19 @@ pub fn targets(manifest: &TomlManifest, | |||
} | |||
|
|||
targets.extend( | |||
clean_bins(manifest.bin.as_ref(), package_root, package_name, warnings, has_lib)? | |||
clean_bins(manifest.bin.as_ref(), package_root, package_name, warnings, errors, has_lib)? |
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.
Hm, now I am not quite sure that we should apply this logic to binaries as well...
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.
Yeah maybe we can stick to just tests/benchmarks for now?
|
||
assert_that(p.cargo("test"), execs().with_status(0)); | ||
assert_that(p.cargo("test").arg("--package").arg("testless"), | ||
execs().with_status(0)); |
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 think this last check is something that we actually gain here.
My undestanding is that with the current cargo it is impossible to do cargo test --package dependency
, if the dep skipped some tests during publishing. Now it is possible.
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.
Ah yeah I think that's ok. This won't work in general due to dev-dependencies anyway (e.g. you can still test the library and it won't link right)
@bors: r+ Oops sorry missed the update here! |
📌 Commit dafab24 has been approved by |
Allow to skip test code during publishing closes #4365 I don't have time to review this code carefully right now, but looks like it does the job.
☀️ Test successful - status-appveyor, status-travis |
[beta] Allow to skip test code during publishing Backport of #4389
closes #4365
I don't have time to review this code carefully right now, but looks like it does the job.