<!---
Thanks so much for your contribution! If this is your first time
contributing, please ensure that you have read the
[CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md)
documentation.
-->
# Description
<!--- Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context. -->
Likewise `require.NoError` instead of `require.Nil`, and `assert.Error`
rather than `assert.NotNil`.
The error variants of these functions print the errors nicer for test
failures using `Error()` rather than `GoString()`.
For bail errors this is _much_ better than the `result.Result` days
where we now get errors like:
```
Error: Received unexpected error:
BAIL: inner error
```
instead of:
```
Error: Expected nil, but got: &simpleResult{}
```
Also print the bail error in `TestPlan.Run` so we can see the
description of it.
The filestate backend implementation drops context in many places
instead opting to use context.TODO.
context.TODO is a TODO--something intended to be addressed.
context.Backgruond is appropriate for process-scoped operations.
In this case, we can resolve the issues and drop all uses of
context.TODO by plumbing the received contexts appropriately.
For localSnapshotPersister, we add a new `ctx` field
because the interface doesn't yet accept a context argument.
This is tracked in #12594.
Result:
```
% rg context.TODO pkg/backend/filestate
[empty]
```
Resolves#12594
The filestate backend now defaults to using project mode for new stores.
This has a side effect of migrating stores in all existing tests
to project mode.
As a result of this, we lost some of the legacy test.
To get around this, create legacy copies of affected tests.
We run them in legacy mode by ensuring that the bucket is non-empty
with a marker file.