Handle output placeholder missing backing file

In preparation for this CL:
https://chromium-review.googlesource.com/c/infra/luci/recipes-py/+/1777143

Currently, if no test step data is provided for a step that uses an
output placeholder, the placeholder evaluates to an empty string. After
that CL lands, the placeholder will instead evaluate to None, breaking
any non-mocked code that assumes a non-null placeholder result.

There were dozens of places where these env var fetches would've needed
mocking, so I figured it was easier to just silently handle the case
where the placeholder backing file doesn't exist. Especially for trivial
cases like these environment variable fetches where the backing file is
a temporary file created just for that step (no `leak_to` argument
specified), it should be impossible for the backing file to not exist
unless you're doing some really weird stuff.

Change-Id: Ibb646142ee8471b2444f54fe78c640a94d18a607
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/240663
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
1 file changed