Description
Problem
Now that we have embedded postgres, the fake database is not needed for quick local environments, and the main purpose is testing.
However, we have to do some nasty stuff, (#2473) to keep it working, and because it is not postgres, it can lead us into a false sense of security about whether our code actually works.
But, we do need a suite of tests that run fast, and our postgres tests are slow.
CLI tests, by and large, shouldn't be calling the server at all, and instead be mocking out the codersdk. That will make them simpler (because you don't need a bunch of preamble to get the DB into the state you want), and super fast. It will also make is easier to test things other than the happy path like errors.
Coderd tests can and should mock out the database interface for most cases, for the same reasons.
We still will want a couple integration tests that go all the way from the CLI -> API -> Database, but there will only be a few and we could use postgres for that.
Once we're in that state, we could consider killing the fake database.