Skip to content

Commit

Permalink
fix import addr
Browse files Browse the repository at this point in the history
  • Loading branch information
mulmuri committed Aug 30, 2023
1 parent f844ec7 commit 1dc4316
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 38 deletions.
2 changes: 1 addition & 1 deletion cmd/compose/benchmark/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"github.com/Goboolean/fetch-server/internal/domain/service/relay"
"github.com/Goboolean/fetch-server/internal/domain/service/transmission"
grpc_infra "github.com/Goboolean/fetch-server/internal/infrastructure/grpc"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/rdbms"
"github.com/Goboolean/fetch-server/internal/infrastructure/redis"
mock_infra "github.com/Goboolean/fetch-server/internal/infrastructure/ws/mock"
_ "github.com/Goboolean/fetch-server/internal/util/env"
"github.com/Goboolean/shared/pkg/broker"
"github.com/Goboolean/shared/pkg/mongo"
)

// This package is for bemchmark test
Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/develop/develop.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/Goboolean/fetch-server/cmd/inject"
"github.com/Goboolean/fetch-server/internal/domain/service/persistence"
"github.com/Goboolean/fetch-server/internal/domain/service/transmission"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/rdbms"
"github.com/Goboolean/fetch-server/internal/infrastructure/redis"
"github.com/Goboolean/shared/pkg/mongo"
"github.com/joho/godotenv"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/develop/develop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"github.com/Goboolean/fetch-server/internal/domain/service/relay"
"github.com/Goboolean/fetch-server/internal/domain/service/transmission"
grpc_infra "github.com/Goboolean/fetch-server/internal/infrastructure/grpc"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/rdbms"
"github.com/Goboolean/fetch-server/internal/infrastructure/redis"
mock_infra "github.com/Goboolean/fetch-server/internal/infrastructure/ws/mock"
_ "github.com/Goboolean/fetch-server/internal/util/env"
"github.com/Goboolean/shared/pkg/broker"
"github.com/Goboolean/shared/pkg/mongo"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/released/released.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/Goboolean/fetch-server/cmd/inject"
"github.com/Goboolean/fetch-server/internal/domain/service/persistence"
"github.com/Goboolean/fetch-server/internal/domain/service/transmission"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/rdbms"
"github.com/Goboolean/fetch-server/internal/infrastructure/redis"
"github.com/Goboolean/shared/pkg/mongo"
"github.com/joho/godotenv"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/compose/withmockdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/Goboolean/fetch-server/cmd/inject"
"github.com/Goboolean/fetch-server/internal/domain/service/persistence"
"github.com/Goboolean/fetch-server/internal/domain/service/transmission"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/rdbms"
"github.com/Goboolean/fetch-server/internal/infrastructure/redis"
"github.com/Goboolean/fetch-server/internal/infrastructure/ws/mock"
"github.com/Goboolean/shared/pkg/mongo"
"github.com/joho/godotenv"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/inject/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/Goboolean/fetch-server/internal/domain/port/in"
"github.com/Goboolean/fetch-server/internal/infrastructure/grpc"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/rdbms"
"github.com/Goboolean/fetch-server/internal/infrastructure/redis"
"github.com/Goboolean/fetch-server/internal/infrastructure/ws"
Expand All @@ -19,7 +20,6 @@ import (
"github.com/Goboolean/fetch-server/internal/infrastructure/ws/polygon"
"github.com/Goboolean/fetch-server/internal/util/prometheus"
"github.com/Goboolean/shared/pkg/broker"
"github.com/Goboolean/shared/pkg/mongo"
"github.com/Goboolean/shared/pkg/resolver"
"github.com/google/wire"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/inject/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
persistence_adapter "github.com/Goboolean/fetch-server/internal/adapter/persistence"
"github.com/Goboolean/fetch-server/internal/adapter/transaction"
"github.com/Goboolean/fetch-server/internal/adapter/websocket"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/rdbms"
"github.com/Goboolean/shared/pkg/broker"
"github.com/Goboolean/shared/pkg/mongo"

"github.com/Goboolean/fetch-server/internal/domain/port"
"github.com/Goboolean/fetch-server/internal/domain/port/in"
Expand Down
2 changes: 1 addition & 1 deletion cmd/inject/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/adapter/persistence/persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/Goboolean/fetch-server/internal/domain/port"
"github.com/Goboolean/fetch-server/internal/domain/port/out"
"github.com/Goboolean/fetch-server/internal/domain/vo"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/rdbms"
"github.com/Goboolean/fetch-server/internal/util/prometheus"
"github.com/Goboolean/shared/pkg/mongo"
)

type Adapter struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/adapter/transaction/constructor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"

"github.com/Goboolean/fetch-server/internal/domain/port"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/rdbms"
"github.com/Goboolean/shared/pkg/mongo"
)

type Tx struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/infrastructure/mongo/constructor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"testing"

"github.com/Goboolean/shared/pkg/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
"github.com/Goboolean/shared/pkg/resolver"
"github.com/joho/godotenv"
)
Expand Down
21 changes: 6 additions & 15 deletions internal/infrastructure/mongo/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ import (
"testing"
"time"

"github.com/Goboolean/shared/pkg/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
)



func Test_InsertStockBatch(t *testing.T) {

var (
stockId = "stock.goboolean.test"
stockBatch = []*mongo.StockAggregate{{},{},{}}
stockId = "stock.goboolean.test"
stockBatch = []*mongo.StockAggregate{{}, {}, {}}
)


tx, err := instance.NewTx(context.Background())
if err != nil {
t.Errorf("failed to start transaction: %v", err)
Expand All @@ -45,8 +42,6 @@ func isEqual(send, received []*mongo.StockAggregate) bool {
return true
}



func Test_FetchAllStockBatch(t *testing.T) {

var stockId = "stock.goboolean.test"
Expand Down Expand Up @@ -74,13 +69,11 @@ func Test_FetchAllStockBatch(t *testing.T) {
}
}



func Test_FetchAllStockBatchMassive(t *testing.T) {

var (
stockId = "stock.goboolean.test"
stockBatch = []*mongo.StockAggregate{{},{},{}}
stockId = "stock.goboolean.test"
stockBatch = []*mongo.StockAggregate{{}, {}, {}}
)

ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
Expand All @@ -99,7 +92,7 @@ func Test_FetchAllStockBatchMassive(t *testing.T) {

received := make([]*mongo.StockAggregate, 0)

loop:
loop:
for {
select {
case <-ctx.Done():
Expand All @@ -117,5 +110,3 @@ func Test_FetchAllStockBatchMassive(t *testing.T) {
t.Errorf("FetchAllStockBatchMassive() failed: send and received are not equal")
}
}


16 changes: 4 additions & 12 deletions internal/infrastructure/mongo/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import (
"context"
"testing"

"github.com/Goboolean/shared/pkg/mongo"
"github.com/Goboolean/fetch-server/internal/infrastructure/mongo"
)



func Test_Commit(t *testing.T) {

var stockId = "stock.goboolean.test"
Expand All @@ -32,13 +30,11 @@ func Test_Commit(t *testing.T) {

}



func Test_Rollback(t *testing.T) {

var (
stockId = "stock.goboolean.test"
stockBatch = []*mongo.StockAggregate{{},{},{}}
stockId = "stock.goboolean.test"
stockBatch = []*mongo.StockAggregate{{}, {}, {}}
)

tx, err := instance.NewTx(context.Background())
Expand Down Expand Up @@ -77,8 +73,6 @@ func Test_Rollback(t *testing.T) {
}
}



func Test_CommitAfterRollback(t *testing.T) {

tx, err := instance.NewTx(context.Background())
Expand All @@ -99,8 +93,6 @@ func Test_CommitAfterRollback(t *testing.T) {

}



func Test_CommitWithoutExec(t *testing.T) {

tx, err := instance.NewTx(context.Background())
Expand All @@ -114,4 +106,4 @@ func Test_CommitWithoutExec(t *testing.T) {
return
}

}
}

0 comments on commit 1dc4316

Please sign in to comment.