Skip to content

Commit

Permalink
Merge pull request #24 from a-company-jp/add-firebaserc
Browse files Browse the repository at this point in the history
Firebase Emulatorの設定修正
  • Loading branch information
Shion1305 authored Apr 14, 2024
2 parents 70eb391 + c90d5ed commit 72db139
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "lgtmgen-project"
}
}
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ require (
github.com/gin-contrib/cors v1.7.1
github.com/gin-gonic/gin v1.9.1
github.com/godruoyi/go-snowflake v0.0.2
github.com/google/uuid v1.6.0
github.com/joho/godotenv v1.5.1
github.com/stretchr/testify v1.9.0
google.golang.org/api v0.170.0
gopkg.in/gographics/imagick.v3 v3.5.3
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -28,6 +28,7 @@ require (
github.com/bytedance/sonic v1.11.3 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
Expand All @@ -41,6 +42,7 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -51,6 +53,7 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
go.opencensus.io v0.24.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/testutil/firebase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type FirebaseTest struct {
func NewFirebaseTest() *FirebaseTest {
ctx := context.Background()
conf := &fb.Config{
DatabaseURL: "localhost:9000/?ns=testdb",
DatabaseURL: "localhost:9000/?ns=lgtmgen-project-default-rtdb",
}
app, err := fb.NewApp(ctx, conf)
if err != nil {
Expand Down
11 changes: 5 additions & 6 deletions svc/pkg/infra/fb/lgtm_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package infra

import (
"github.com/stretchr/testify/assert"
"lgtm-gen/pkg/testutil"
"lgtm-gen/svc/pkg/domain/model"
"testing"
Expand All @@ -13,17 +14,17 @@ func TestLGTMTable_Set(t *testing.T) {
client := NewLGTMTable(fb.GetClient())
testdata := []model.LGTM{
{
ID: "1",
ID: "1234",
Url: "https://example.com/img/1",
CreatedAt: time.Now().Add(-2 * time.Hour),
},
{
ID: "2",
ID: "1235",
Url: "https://example.com/img/2",
CreatedAt: time.Now().Add(-time.Hour),
},
{
ID: "3",
ID: "1236",
Url: "https://example.com/img/3",
CreatedAt: time.Now().Add(-30 * time.Minute),
},
Expand All @@ -47,8 +48,6 @@ func TestLGTMTable_Set(t *testing.T) {
if d.Url != results[i].Url {
t.Fatalf("results[%d].Url got: %s, want: %s", i, results[i].Url, d.Url)
}
if d.CreatedAt != results[i].CreatedAt {
t.Fatalf("results[%d].CreatedAt got: %v, want: %v", i, results[i].CreatedAt, d.CreatedAt)
}
assert.True(t, d.CreatedAt.Equal(results[i].CreatedAt))
}
}

0 comments on commit 72db139

Please sign in to comment.