Are there any good, idiomatic, approaches out there to organising test fixtures which need to be used in both unit & integration tests?
I currently have:
src
| ...
| - test_fixtures
| | - mod.rs
| - - albums.rs # hard coded expected results & asset loaders
tests
| - assets # stuff that needs network or hardware access
| | - definitely_maybe
| | | - TOC.hex
| | | - musicbrainz.json
| | | ...
...
Cargo.toml
...
[features]
# for integration testing - expected results correlating to tests/assets
test_fixtures = ["dep:serde_json"]
...
But this requires me to always run cargo test --all-features
If I try using #[path(...)]in the integration tests as suggested a few years ago. I still run into the issue that my fixtures are either part of the default library code, or feature-gated and tests need all-features. [edit: plus I get issues with import crate::something_pub_crate; in my fixtures]
Thanks in advance