27c8345ef2
chore: Add linter rule to prevent breaking of sse ( #4144 )
...
* chore: Add linter rule to prevent breaking of sse
2022-09-27 11:14:58 -04:00
5de6f86959
feat: trace httpapi.{Read,Write} ( #4134 )
2022-09-21 17:07:00 -05:00
01fe5e668e
chore: add testutil.Eventually and friends ( #3389 )
...
This PR adds a `testutil` function aimed to replace `require.Eventually`.
Before:
```go
require.Eventually(t, func() bool { ... }, testutil.WaitShort, testutil.IntervalFast)
```
After:
```go
require.True(t, testutil.EventuallyShort(t, func(ctx context.Context) bool { ... }))
// or the full incantation if you need more control
ctx, cancel := context.WithTimeout(ctx.Background(), testutil.WaitLong)
require.True(t, testutil.Eventually(t, ctx, func(ctx context.Context) bool { ... }, testutil.IntervalSlow))
```
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com >
2022-08-05 16:34:44 +01:00
4730c589fe
chore: Use standardized test timeouts and delays ( #3291 )
2022-08-01 15:45:05 +03:00
51dd1fde3b
fix: Remove use of require
in require.Eventually
in tests ( #3110 )
...
* fix: Remove use of `require` in `require.Eventually` in tests
Because require uses `t.FailNow()` and `require.Eventually` runs the
function in a goroutine, which is not allowed.
* feat: Add ruleguard for require.Eventually
Co-authored-by: Cian Johnston <cian@coder.com >
2022-07-22 20:02:49 +03:00
576aef40f2
chore: Add linter rule to catch missing return after http writes ( #2702 )
2022-06-28 14:13:37 -05:00
251316751e
feat: Return more 404s vs 403s ( #2194 )
...
* feat: Return more 404s vs 403s
* Return vague 404 in all cases
2022-06-14 10:14:05 -05:00
af401e3fe1
chore: Linter rule for properly formatted api errors ( #2123 )
...
* chore: Linter rule for properly formatted api errors
* Add omitempty to 'Detail' field
2022-06-07 14:33:06 +00:00
e6ee7dd652
chore: Add linting rule to help catch InTx misuse ( #1980 )
...
* chore: Add linting rule to help catch InTx misuse
This isn't perfect, as if you nest your misuse in another code block
like an if statement, it won't catch it :/. It is better
than nothing
2022-06-02 14:50:15 +00:00
c2f74f3cc2
chore: avoid concurrent usage of t.FailNow ( #1683 )
...
* chore: golangci: add linter rule to report usage of t.FailNow inside goroutines
* chore: avoid t.FailNow in goroutines to appease the race detector
2022-05-24 08:58:39 +01:00
6c1117094d
chore: Force codersdk to not import anything from database ( #1576 )
...
* chore: Force codersdk to not import anything from database (linter rule)
* chore: Move all database types in codersdk out
2022-05-19 13:04:44 -05:00