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

Improve caching #287

Open
3 tasks
rmarescu opened this issue Jan 23, 2025 · 0 comments
Open
3 tasks

Improve caching #287

rmarescu opened this issue Jan 23, 2025 · 0 comments

Comments

@rmarescu
Copy link
Member

rmarescu commented Jan 23, 2025

What

  • Create one cache file per test <TIMESTAMP>—<SHA-1>.json
    • Having a timestamp associated should make it easier for the developer to find a test, and to purge cache chronologically
    • Use the first 8 characters of the SHA-1 value
  • Create a folder with the same name of the cache file to store the screenshots
    .shortest/cache/2025-01-07T04-40-01-311Z-a79d4f5a.json
    .shortest/cache/2025-01-07T04-40-01-311Z-a79d4f5a/*.png
    
  • Consider using cache versioning prefix for breaking changes
    • With certain versions the cache may break, so this would allow to migrate easily, multiple versions can coexist, easy rollback, no manual cache cleanup needed between versions

Why

With caching, it's difficult to tell which screenshots are associated with a given test. The screenshots should be somehow associated with the cached test.
All cached tests are stored in a single file cache.json. With a project that has many tests, I think that could cause problems. Also, is hard to find and debug a given test.

Example

No response

@rmarescu rmarescu moved this to Scoping needed in Shortest Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Scoping needed
Development

No branches or pull requests

1 participant