mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-24 10:18:11 +00:00
This adds a simple sharness snapshot test for the new instance system, in the model of the old [test_load_example_github.t][old]. I've setup a very simple test instance with the GitHub and Discourse plugins, and we verify that the output generated by running `load`, `graph`, and `score` in succession is stable. (Cache is not persisted.) This is a nice sanity check to verify that nothing ever gets totally broken; we'll still want to add unit testing for more specific features and edge cases. Test plan: `yarn test --full` passes. If you `rm -rf sharness/test-instance/output`, then `yarn test --full` fails. If you then run `./scripts/update_snapshots.sh`, then the output directory will be restored; afterwards `yarn test --full` passes again. To verify that the snapshots are valid, you can test them with the frontend: `yarn start --instance sharness/__snapshots__/test-instance` If you are actually debugging this script, rather than using `yarn test --full` you'll want to invoke `(cd sharness; ./load_test_instance.t -l -v)` [old]: https://github.com/sourcecred/sourcecred/blob/v0.6.0/sharness/test_load_example_github.t