Closed afranchuk closed 1 year ago
I've previously seen feedback that people want to be able to run the tests on the published crate. Is there a common stance in the rust community for including or excluding tests?
It may not be common, but I can imagine people wanting to run cargo install --example dwarfdump gimli
.
Ah, if you've had that feedback then I don't see an alternative (aside from downloading the files, either automatically or manually). Though I would be curious why those who say that aren't happy with running tests from a checkout of the repository.
The only sentiment on the matter that I've seen is that when publishing to crates.io, those files are intended to only be for crates.io and package resolution (and notably those files will persist "forever").
Crater runs tests for all crates published on crates.io.
How about moving the tests that need these fixtures in a separately published crate?
I think it's fine to exclude fixtures
and the tests/benchmarks that need them (which is all of tests
and benches
currently).
I prefer not to exclude examples, but moving them to a separate crate is an option.
Are you willing to accept a PR for this change, or is it too organizational in nature (e.g. deciding crate names, choosing what code to move, etc)?
Is excluding fixtures
enough to meet your immediate need?
For moving the examples, a similar thing was done for the object
crate, so my default action would be to do the same thing here, but I'm open to suggestions for better ways to organise things. I think we should also start using object-testfiles
for binaries for regression tests.
Yes, excluding fixtures
will be sufficient (it cuts the crate size down ~45%).
If I understand correctly, the fixtures are all used in the integration tests. To reduce unnecessary files (especially for those of us who mirror/vendor third-party crates), it'd be nice if the fixtures (and maybe the tests/examples?) were excluded when publishing. I realize that e.g. excluding examples will not allow a user to run
cargo install --examples -- gimli
, but I think that's of fairly little use.