Fix "ignoring test" warning with "cargo publish"

⚓ Rust    📅 2025-11-20    👤 surdeus    👁️ 8      

surdeus

The rust_xlsxwriter crate has a lot of Excel xlsx files that are used for testing and that I would prefer to omit from the published package to reduce the size (-12MB):

$ du -hs tests/input
12M    tests/input

In order to do that I put the following exclude in Cargo.toml:

exclude = ["tests/**/*"]

That excludes the xlsx files for testing and also the integration test files but gives the following warning on cargo publish:

$ cargo publish --dry-run
    Updating crates.io index
   Packaging rust_xlsxwriter v0.92.2 (/path/rust/rust_xlsxwriter)

warning: ignoring test `integration` as `tests/integration/main.rs` 
         is not included in the published package

...

Is there a way to avoid this warning so that I only see other warnings before publishing?

2 posts - 2 participants

Read full topic

🏷️ Rust_feed