Environments and testing best practices

Heyo!
I’m using the Rails gem, and would like some best practices guidance.

First: Separating multiple versions of the same env (IE multi-dev environment)

Am I right in thinking, that the best practice for multiple development and staging environments is to somehow set something like

ENV['DEVELOPER_NAME']

as a prefix to the environment?

Second: The bigger question I have revolves more around testing.
Since search is going to potentially be the most important part of our application, the features around it cannot go untested.
I was wondering what kind of best practices you would suggest on how to approach this - should I record and stub every request? I think that might blow up in size quite a lot. But can’t think of any other reasonable approaches.

Looking forward to hearing your thoughts

Hi there,

Multiple environments:
The best way to go about multiple environments is indeed to add a token to your index names.
https://www.algolia.com/doc/api-client/rails/options/#per-environment-indices

Testing:
Regarding tests, it really depends on the use case.
You could choose to do some snapshot tests on a few queries that are crucial.

Let’s say you are building a search where you’d like your user to find a specific product given a SKU, then you would try to single critical query and make sure it returns de expected result.

I wouldn’t go for too much intensive e2e testing though because it would mainly be just create noise (IMHO).

Everything really depends on your use case though, please tell us more about what’s critical in your search usage, maybe we could come up with some useful ways to test relevant parts.