Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore(site): remove dbmem from tests#18802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugodutka merged 1 commit intomainfromhugodutka/dbmem-site
Jul 8, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletionssite/site_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,7 +27,6 @@ import (
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/db2sdk"
"github.com/coder/coder/v2/coderd/database/dbgen"
"github.com/coder/coder/v2/coderd/database/dbmem"
"github.com/coder/coder/v2/coderd/database/dbtestutil"
"github.com/coder/coder/v2/coderd/database/dbtime"
"github.com/coder/coder/v2/coderd/httpmw"
Expand All@@ -46,7 +45,7 @@ func TestInjection(t *testing.T) {
},
}
binFs := http.FS(fstest.MapFS{})
db:=dbmem.New()
db, _:=dbtestutil.NewDB(t)
handler := site.New(&site.Options{
Telemetry: telemetry.NewNoop(),
BinFS: binFs,
Expand All@@ -73,13 +72,17 @@ func TestInjection(t *testing.T) {
// This will update as part of the request!
got.LastSeenAt = user.LastSeenAt

// json.Unmarshal doesn't parse the timezone correctly
got.CreatedAt = got.CreatedAt.In(user.CreatedAt.Location())
got.UpdatedAt = got.UpdatedAt.In(user.CreatedAt.Location())

require.Equal(t, db2sdk.User(user, []uuid.UUID{}), got)
}

func TestInjectionFailureProducesCleanHTML(t *testing.T) {
t.Parallel()

db:=dbmem.New()
db, _:=dbtestutil.NewDB(t)

// Create an expired user with a refresh token, but provide no OAuth2
// configuration so that refresh is impossible, this should result in
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp