Skip to content

Commit

Permalink
Reduce chunks storage usage in integration tests (cortexproject/corte…
Browse files Browse the repository at this point in the history
…x#4296)

* Reduce chunks storage usage in integration tests

Signed-off-by: Marco Pracucci <[email protected]>

* Fixed userID in integration tests

Signed-off-by: Marco Pracucci <[email protected]>

* Deleted unused code

Signed-off-by: Marco Pracucci <[email protected]>

* Fixed 'make doc'

Signed-off-by: Marco Pracucci <[email protected]>
  • Loading branch information
pracucci authored Jun 21, 2021
1 parent cf57892 commit 9d848d2
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@ package e2edb

import (
"fmt"
"net/url"
"strings"

"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodb"
awscommon "github.com/weaveworks/common/aws"

"github.com/cortexproject/cortex/integration/e2e"
"github.com/cortexproject/cortex/integration/e2e/images"
)
Expand Down Expand Up @@ -70,26 +65,6 @@ func NewETCD() *e2e.HTTPService {
)
}

func NewDynamoClient(endpoint string) (*dynamodb.DynamoDB, error) {
dynamoURL, err := url.Parse(endpoint)
if err != nil {
return nil, err
}

dynamoConfig, err := awscommon.ConfigFromURL(dynamoURL)
if err != nil {
return nil, err
}

dynamoConfig = dynamoConfig.WithMaxRetries(0)
dynamoSession, err := session.NewSession(dynamoConfig)
if err != nil {
return nil, err
}

return dynamodb.New(dynamoSession), nil
}

func NewDynamoDB() *e2e.HTTPService {
return e2e.NewHTTPService(
"dynamodb",
Expand All @@ -100,35 +75,3 @@ func NewDynamoDB() *e2e.HTTPService {
8000,
)
}

// while using Bigtable emulator as index store make sure you set BIGTABLE_EMULATOR_HOST environment variable to host:9035 for all the services which access stores
func NewBigtable() *e2e.HTTPService {
return e2e.NewHTTPService(
"bigtable",
images.BigtableEmulator,
nil,
nil,
9035,
)
}

func NewCassandra() *e2e.HTTPService {
return e2e.NewHTTPService(
"cassandra",
images.Cassandra,
nil,
// readiness probe inspired from https://github.com/kubernetes/examples/blob/b86c9d50be45eaf5ce74dee7159ce38b0e149d38/cassandra/image/files/ready-probe.sh
e2e.NewCmdReadinessProbe(e2e.NewCommand("bash", "-c", "nodetool status | grep UN")),
9042,
)
}

func NewSwiftStorage() *e2e.HTTPService {
return e2e.NewHTTPService(
"swift",
images.SwiftEmulator,
nil,
e2e.NewHTTPReadinessProbe(8080, "/", 404, 404),
8080,
)
}

0 comments on commit 9d848d2

Please sign in to comment.