Fix the test auth server's upload handler#57601
Conversation
| AccessLists: accessLists, | ||
| FIPS: cfg.FIPS, | ||
| KeyStoreConfig: cfg.KeystoreConfig, | ||
| MultipartHandler: uploadHandler, |
There was a problem hiding this comment.
Does it have to be the same uploader or can it be a fresh instance of eventstest.NewMemoryUploader()?
If the latter then I'd suggest doing so to keep the complexity lower.
Should we set MultipartHandler: eventstest.NewMemoryUploader(), in other tests too?
There was a problem hiding this comment.
@Tener I would argue that using the same instance will better reflect the behavior of a real component. The real one is based on a filesystem, and multiple instances — if configured the same way — will share the same space of uploaded files. Since a memory uploader manages its own internal set of "uploads" in memory, using the same one everywhere brings us closer to the behavior of a production system. A more accurate solution would be to implement the upload set separately and provide thin interfaces over it, but this would actually increase complexity instead.
As for other tests — I honestly don't know, and I didn't consider it. If you think that they need to be changed, we can do it separately, as my goal here is to unblock an enterprise PR whose tests depend on it.
The server didn't have its upload handler properly configured, which prevented me from uploading session summaries in unit tests.
Blocks https://github.com/gravitational/teleport.e/pull/7015