ChainSafe / forest

🌲 Rust Filecoin Node Implementation
https://forest.chainsafe.io
Apache License 2.0
638 stars 156 forks source link

Write tests (ui) tests against specific snapshots #3460

Open aatifsyed opened 1 year ago

aatifsyed commented 1 year ago

3430 needs a way to run a snapshot test against a specific snapshot, but we don't have testing infrastructure for that yet.

I want to write this

#[test]
fn regression() {
    let snapshot = Snapshot::fixed("...");
    let expected = LotusHarness::fixed("1.23.3")
                   .run("...")
                   // ...
    let actual = forest_tool().run("...");
    assert_eq!(sanitised(expected), sanitised(actual));
}

#[test]
fn conformance() {
   let snapshot = Snapshot::latest();
   let expected = LotusHarness::latest();
   //...
}

The issue tracks:

lemmih commented 1 year ago

We have migration tests that target specific calibnet snapshots. I'm not sure if this is the kind of thing you're referring to.

https://github.com/ChainSafe/forest/blob/main/scripts/tests/calibnet_migration_regression_tests.sh