Skip to content

Conversation

@rassie
Copy link

@rassie rassie commented Nov 25, 2025

Summary

Add server-side API to accept snapshot updates by copying actual snapshots to expected locations:

  • Add acceptSnapshots() method to TestServerInterface
  • Implement handler in TestServerDispatcher that copies files and creates destination directories
  • Add connection method in TestServerConnection
  • Add test coverage for success and error cases

This is a backend-only change that adds the infrastructure for accepting snapshot updates. No UI changes included.

Context

Split out from #38321 per reviewer feedback requesting smaller, incremental changes.

This PR contains only the backend API. Frontend changes will follow in a separate PR once this is merged.

Add server-side API to copy actual snapshots to expected locations:

- Add acceptSnapshots() to TestServerInterface
- Implement handler in TestServerDispatcher
- Add connection method in TestServerConnection
- Add test coverage for the API

This is a backend-only change that adds the infrastructure for
accepting snapshot updates. No UI changes included.

async ping() {}

async acceptSnapshots(params: Parameters<TestServerInterface['acceptSnapshots']>[0]): ReturnType<TestServerInterface['acceptSnapshots']> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really a copyFile rather than accept snapshot endpoint. If we have it in this shape, we need to add some security considerations to prevent data loss and misuse.

Btw, do you know that there is a checkbox setting in the sidebar that allows accepting changed the snapshots on the test runs? Why not to just run it and then explore the diffs?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback and the pointer, I'll have to explore that. From your description it sounds like it accepts all changed snapshots on a run, but if the run is restricted to a subset of tests it might be functionally equivalent to what I'm trying to do. Let me get back to you with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants