mirror of
https://github.com/coder/coder.git
synced 2026-06-07 15:08:20 +00:00
chore: update to Go 1.25.6 and coder/preview to 1.08 (cherry 2.29) (#23228)
- Update Go version from 1.24.11 to 1.25.6
- Remove dependency on `moby` for `namesgenerator`
- Disable any use of trivy in zizmor GH action linting
(https://github.com/coder/coder/pull/23228/commits/17532ef2a8e40784499c36d3e7b871a2109d9bf2)
---------
(cherry picked from commit 3ee4f6d0ec)
(cherry picked from commit
https://github.com/coder/coder/commit/091d31224d2fe00d83695adcc53a225842dbb8d3)
(cherry picked from commit
https://github.com/coder/coder/commit/b44a421412a12ef7222322c68109426fb1f65286)
---------
Co-authored-by: Danny Kopping <danny@coder.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Zach <3724288+zedkipp@users.noreply.github.com>
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
package coderdtest_test
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
"unicode"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/goleak"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/coderdtest"
|
||||
@@ -28,3 +31,22 @@ func TestNew(t *testing.T) {
|
||||
_, _ = coderdtest.NewGoogleInstanceIdentity(t, "example", false)
|
||||
_, _ = coderdtest.NewAWSInstanceIdentity(t, "an-instance")
|
||||
}
|
||||
|
||||
func TestRandomName(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
for range 10 {
|
||||
name := coderdtest.RandomName(t)
|
||||
|
||||
require.NotEmpty(t, name, "name should not be empty")
|
||||
require.NotContains(t, name, "_", "name should not contain underscores")
|
||||
|
||||
// Should be title cased (e.g., "Happy Einstein").
|
||||
words := strings.Split(name, " ")
|
||||
require.Len(t, words, 2, "name should have exactly two words")
|
||||
for _, word := range words {
|
||||
firstRune := []rune(word)[0]
|
||||
require.True(t, unicode.IsUpper(firstRune), "word %q should start with uppercase letter", word)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user