How do you keep test environments comparable without pretending they are identical to production?
Answer
Version infrastructure and configuration, separate secrets, use production-like topology and data shape, and continuously detect drift. Document intentional differences and ensure tests that depend on them run at an appropriate later stage.
Strong answer includes
- versioned configuration
- drift detection
- explicit environment differences
Practical example
A staging environment silently drifts from production because someone manually bumped a feature flag directly in the staging dashboard six months ago; a drift-detection job comparing staging's infrastructure-as-code state against what's actually deployed catches the mismatch and the team documents it as an intentional, tracked exception instead of an unnoticed discrepancy.