mirror of
https://github.com/coder/coder.git
synced 2025-03-14 10:09:57 +00:00
* assert provisioner daemon version and api_version in unit tests * add build info in HTTP header, extract codersdk.BuildVersionHeader * add api_version to codersdk.ProvisionerDaemon * testutil.MustString -> testutil.MustRandString
18 lines
308 B
Go
18 lines
308 B
Go
package testutil
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/coder/coder/v2/cryptorand"
|
|
)
|
|
|
|
// MustRandString returns a random string of length n.
|
|
func MustRandString(t *testing.T, n int) string {
|
|
t.Helper()
|
|
s, err := cryptorand.String(n)
|
|
require.NoError(t, err)
|
|
return s
|
|
}
|