zerocopy icon indicating copy to clipboard operation
zerocopy copied to clipboard

Consider not packaging tests on releases

Open emilio opened this issue 2 years ago • 4 comments

We, in Firefox, are going to import zerocopy. We require having our sources vendored, and this crate is no exception. However this crate bundles a lot of tests in the package, which would be nice not to vendor.

Could you consider adding something like:

[package]
exclude = ["/tests"]

to the cargo metadata? Sorry if that was already considered.

emilio avatar Jan 11 '24 13:01 emilio

Yeah that's definitely something we can consider. I'll discuss it with @jswrenn.

Out of curiosity, is the concern about total file size, or just about having many small files checked into source control, or something else?

joshlf avatar Jan 11 '24 14:01 joshlf

I think that we could do this for our integration tests, provided that we factor them out into a separate tests-only crate that is packaged on crates.io. Otherwise, our tests wouldn't be included in crater runs.

jswrenn avatar Jan 11 '24 14:01 jswrenn

Out of curiosity, is the concern about total file size, or just about having many small files checked into source control, or something else?

Mostly file size and review-ability / searchability. Makes missing actual code that matters easier imo.

emilio avatar Jan 11 '24 15:01 emilio

Jack and I discussed this, and our main concern is that we want to make sure any consumers of the published crate files can run tests if they want to. The most important user of this is Crater - we want to make sure that zerocopy is fully exercised in any Crater run - but presumably there are other users who make use of this as well (e.g. to run tests locally when vendoring).

I've submitted a feature request to cargo vendor to support this natively. In the meantime, would it be feasible for you to just rm -r tests during your vendoring process?

joshlf avatar Feb 21 '24 18:02 joshlf