Skip to content

Commit

Permalink
docker-compose.yml ; Dockerfile.test ; connect to yugabyte and not …
Browse files Browse the repository at this point in the history
…localhost
  • Loading branch information
nonsense committed May 8, 2023
1 parent 508bd8a commit 3a02875
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 11 deletions.
8 changes: 8 additions & 0 deletions extern/boostd-data/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM golang:1.18-alpine

WORKDIR /go/src/

ENV CGO_ENABLED=0

ENTRYPOINT ["go", "test"]
CMD ["-v", "./..."]
19 changes: 19 additions & 0 deletions extern/boostd-data/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '3.7'

services:

yugabyte:
image: public.ecr.aws/n6b0k8i7/yugabyte-test:x86_64-2.17.2.0
ports:
- 9042:9042
restart: on-failure

go-tests:
build:
context: .
dockerfile: ./Dockerfile.test
environment:
YUGABYTE_HOST: yugabyte
volumes:
- ./:/go/src/
command: -v -count=1 -p=1 ./...
12 changes: 7 additions & 5 deletions extern/boostd-data/svc/svc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ var testCouchSettings = couchbase.DBSettings{
}

var testYugaSettings = yugabyte.DBSettings{
Hosts: []string{"127.0.0.1"},
ConnectString: "postgresql://postgres:postgres@localhost",
//Hosts: []string{"127.0.0.1"},
Hosts: []string{"yugabyte"},
//ConnectString: "postgresql://postgres:postgres@localhost",
ConnectString: "postgresql://postgres:postgres@yugabyte",
}

func TestService(t *testing.T) {
Expand Down Expand Up @@ -84,7 +86,7 @@ func TestService(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()

SetupYugabyte(t)
// SetupYugabyte(t)

bdsvc := NewYugabyte(testYugaSettings)

Expand Down Expand Up @@ -224,7 +226,7 @@ func TestServiceFuzz(t *testing.T) {
})

t.Run("yugabyte", func(t *testing.T) {
SetupYugabyte(t)
// SetupYugabyte(t)
bdsvc := NewYugabyte(testYugaSettings)

addr := "localhost:8044"
Expand Down Expand Up @@ -458,7 +460,7 @@ func TestCleanup(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()

SetupYugabyte(t)
// SetupYugabyte(t)

bdsvc := NewYugabyte(testYugaSettings)
testCleanup(ctx, t, bdsvc, "localhost:8044")
Expand Down
6 changes: 3 additions & 3 deletions piecedirectory/doctor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ func TestPieceDoctor(t *testing.T) {
prev := yugabyte.MinPieceCheckPeriod
yugabyte.MinPieceCheckPeriod = 1 * time.Second

svc.SetupYugabyte(t)
// svc.SetupYugabyte(t)

bdsvc := svc.NewYugabyte(yugabyte.DBSettings{
Hosts: []string{"127.0.0.1"},
ConnectString: "postgresql://postgres:postgres@localhost",
Hosts: []string{"yugabyte"},
ConnectString: "postgresql://postgres:postgres@yugabyte",
})

addr := "localhost:8044"
Expand Down
6 changes: 3 additions & 3 deletions piecedirectory/piecedirectory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ func TestPieceDirectory(t *testing.T) {
})

t.Run("yugabyte", func(t *testing.T) {
svc.SetupYugabyte(t)
// svc.SetupYugabyte(t)

bdsvc := svc.NewYugabyte(yugabyte.DBSettings{
Hosts: []string{"127.0.0.1"},
ConnectString: "postgresql://postgres:postgres@localhost",
Hosts: []string{"yugabyte"},
ConnectString: "postgresql://postgres:postgres@yugabyte",
})

addr := "localhost:8044"
Expand Down

0 comments on commit 3a02875

Please sign in to comment.