stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
118 stars 66 forks source link

Feature to easily opt out of test_snapshots generation #1306

Closed kalepail closed 1 month ago

kalepail commented 1 month ago

What problem does your feature solve?

Test snapshots are big and not always used, especially in the early days of contract development. My preference is they be opt in, but at the very least there should be an easy way to opt out.

What would you like to see?

#[test]
#![no_test_snapshot]
fn test() {
}

or

fn test() {
let env = Env::default();
env.no_test_snapshots();
}

What alternatives are there?

Pain, frustration and madness. (and large directories)


Should we be encouraging folks to .gitignore test_snapshots? Seems like yes again as they are large files and tbh I'm not entire sure what the intended flow for actually making use of them is. Do we actually document test snapshot usage anywhere?

leighmcculloch commented 1 month ago

@kalepail I've opened a change adding a function for testing an Env's test config, which is where the flag for controlling test snapshots can be found. It's similar to your second example above. Check it out here: