Can one HAR recording cover staging and prod, or is it per environment?
Asked 5,210 views1 answer
14votes
We have three environments that serve identical payloads. Re-recording the same traffic three times feels silly. sdods har list prints an env column so I assume the answer is no, but before I go symlinking directories: is the environment part of the lookup, or just part of the display?
The directory comes from the resolved environment name, so a scenario running with -e staging can only ever see har/staging/. There is no fallback to another env and no way to point one env at another file.
The tag names the file, the environment names the directory. So @har:products is one tag that maps to a different recording per env, which is usually what you want anyway: the hosts in the recorded URLs differ per environment, and a staging HAR replayed against prod URLs would miss on every entry.
Do not symlink. The sidecar records which project and env it was captured against, and the first time the payloads diverge you will spend an afternoon working out why one env is asserting on the other one’s data.