x/pkgsite: ./all.bash should attempt to run postgres tests by default #39713
Comments
Hmm, I'm not sure if I agree. This would once again break It's true that some test successes are different from others, but that will generally be true for many other reasons. Some tests will require specific programs to be installed, or they might require Linux or Windows to run. Should all of those also fail unless they're actually running properly? I think you should go the other way around. In
and in the Go code to handle the case where the DB isn't available:
That way, you have the best of both worlds. It's possible for "run all the tests properly" to be done, and you're not messing with people who just want to run the tests on a best-effort basis. A slight variant is what @bcmills suggested in the original issue, which is to make each TestMain start up a temporary postgres on-demand, and only do the skip-or-error dance when postgres isn't installed, which is less likely to be true than "postgres isn't running". |
Ah nice, thanks! I like the |
Change https://golang.org/cl/239257 mentions this issue: |
Follow up to #39598:
When running
./all.bash
, it's not clear whether the postgres tests are running or not. Users will just see that tests succeeded, even when the change results in postgres failures. For example, here's./all.bash
output on the same patchset:./all.bash
output with postgres setup:https://gist.github.com/julieqiu/c279934ee6054e7d5900274569c5c0d2
./all.bash
output without postgres setup:https://gist.github.com/bharaththiruveedula/dcfb9770fe99b3ecb8ee7891d8343631
I think we should do the following:
./all.bash
, first check if we can connect to the test databases, before running tests. If not, exit and inform users about the option to bypass postgres tests./cc @jba @mvdan @bharaththiruveedula
The text was updated successfully, but these errors were encountered: