Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when old snapshots are left behind #14

Open
theramis opened this issue Jan 30, 2019 · 4 comments
Open

Error when old snapshots are left behind #14

theramis opened this issue Jan 30, 2019 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@theramis
Copy link
Owner

Currently when a test which has a snapshot is deleted, Snapper ignores the created snapshot on the disk.

It's a manual process to determine whether there are any redundant snapshot files left on the disk.

It would be nice if Snapper was somehow able to tell you there are redundant snapshot files and potentially error when this is happening during a CI build.

@theramis theramis added enhancement New feature or request help wanted Extra attention is needed labels Jan 30, 2019
@viceice
Copy link
Contributor

viceice commented May 28, 2019

Idea for NUnit with update snapshots:

  • on startup find all snapshots
  • on test track used snapshots
  • on shutdown compare and delete old snapshots

I think this should be easy to implement as an extension

@viceice
Copy link
Contributor

viceice commented May 28, 2019

Alternative we can told the user to add a global startup and teardown hook for snapper

@theramis
Copy link
Owner Author

@viceice I was thinking about implementing recently and realised that if I wanted to do something like what you suggested above, it would be super difficult.

Idea for NUnit with update snapshots:

  • on startup find all snapshots
  • on test track used snapshots
  • on shutdown compare and delete old snapshots

I think this should be easy to implement as an extension

For the above idea to work the test run would have to be running all the tests. What should happen if the user provides a filter and only runs one test? Is there a way to find out if the user is running the full test suite?

The only solution I can think of is that I either need to go deep into the implementations of Xunit and Nunit and replicate the logic to determine all possible tests so that I can determine which snapshots should exist or not.

@viceice
Copy link
Contributor

viceice commented Aug 23, 2019

Ok, that looks really framework dependent. 🤔 May be we can simply delete all snapshots if update is active? But for that, we need a possibillity to detect partial test runs too.

At least in nunit this should be possible. I don't know xunit very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants