Skip to content

Forbid writes to filesystem from unit tests #766

@arrayka

Description

@arrayka
  1. Remove all usages of std::fs::* from unit tests
  2. Don't use FileStorageProvider in unit tests.
  3. Use either VirtualStorageProvider::new_memory() when no access to existing files is needed, or VirtualStorageProvider::new_overlay() when read access to existing files is needed.

Two optional steps - investigate if it is feasible, if so, then implement:
4. Forbid usage of std::fs::* in Clippy.toml, use FileStorageProvider instead.
5. Put FileStorageProvider behind cfg(not(any(testing,virtual_storage)))

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions