From 81fcc1c71fa5b71217ebfccb28aaaa521f953bd9 Mon Sep 17 00:00:00 2001 From: "anjali.agarwal" Date: Fri, 6 Oct 2023 13:01:00 +0530 Subject: [PATCH] updated config file --- compass.yaml.example | 6 +++--- .../discovery_repository_test.go | 20 +++++++++---------- .../discovery_search_repository_test.go | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/compass.yaml.example b/compass.yaml.example index 8922c2d6..5cf9ba4e 100644 --- a/compass.yaml.example +++ b/compass.yaml.example @@ -34,7 +34,7 @@ newrelic: elasticsearch: brokers: http://localhost:9200 - request_timeout_in_seconds: 10s + request_timeout: 10s db: host: localhost @@ -47,7 +47,7 @@ db: service: host: localhost port: 8080 - request_timeout_in_seconds: 10s + request_timeout: 10s identity: headerkey_uuid: Compass-User-UUID headerkey_email: Compass-User-Email @@ -56,7 +56,7 @@ service: port: 8081 max_send_msg_size: 33554432 max_recv_msg_size: 33554432 - request_timeout_in_seconds: 5s + request_timeout: 5s worker: enabled: true diff --git a/internal/store/elasticsearch/discovery_repository_test.go b/internal/store/elasticsearch/discovery_repository_test.go index 5befa32a..a3c36136 100644 --- a/internal/store/elasticsearch/discovery_repository_test.go +++ b/internal/store/elasticsearch/discovery_repository_test.go @@ -31,7 +31,7 @@ func TestDiscoveryRepositoryUpsert(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) err = repo.Upsert(ctx, asset.Asset{ ID: "", Type: asset.TypeTable, @@ -50,7 +50,7 @@ func TestDiscoveryRepositoryUpsert(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) err = repo.Upsert(ctx, asset.Asset{ ID: "sample-id", Type: asset.Type("unknown-type"), @@ -69,7 +69,7 @@ func TestDiscoveryRepositoryUpsert(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) // upsert with create_time as a object err = repo.Upsert(ctx, asset.Asset{ @@ -129,7 +129,7 @@ func TestDiscoveryRepositoryUpsert(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) err = repo.Upsert(ctx, ast) assert.NoError(t, err) @@ -178,7 +178,7 @@ func TestDiscoveryRepositoryUpsert(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) err = repo.Upsert(ctx, existingAsset) assert.NoError(t, err) @@ -219,7 +219,7 @@ func TestDiscoveryRepositoryDeleteByID(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) err = repo.DeleteByID(ctx, "") assert.ErrorIs(t, err, asset.ErrEmptyID) }) @@ -241,7 +241,7 @@ func TestDiscoveryRepositoryDeleteByID(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) err = repo.Upsert(ctx, ast) require.NoError(t, err) @@ -288,7 +288,7 @@ func TestDiscoveryRepositoryDeleteByID(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) err = repo.Upsert(ctx, ast1) require.NoError(t, err) @@ -319,7 +319,7 @@ func TestDiscoveryRepositoryDeleteByURN(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) t.Run("should return error if the given urn is empty", func(t *testing.T) { err = repo.DeleteByURN(ctx, "") @@ -378,7 +378,7 @@ func TestDiscoveryRepositoryDeleteByURN(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) err = repo.Upsert(ctx, ast1) require.NoError(t, err) diff --git a/internal/store/elasticsearch/discovery_search_repository_test.go b/internal/store/elasticsearch/discovery_search_repository_test.go index 74f2b97e..de0a4896 100644 --- a/internal/store/elasticsearch/discovery_search_repository_test.go +++ b/internal/store/elasticsearch/discovery_search_repository_test.go @@ -36,7 +36,7 @@ func TestSearcherSearch(t *testing.T) { err = loadTestFixture(cli, esClient, "./testdata/search-test-fixture.json") require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) type expectedRow struct { Type string @@ -388,7 +388,7 @@ func TestSearcherSuggest(t *testing.T) { err = loadTestFixture(cli, esClient, "./testdata/suggest-test-fixture.json") require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) t.Run("fixtures", func(t *testing.T) { testCases := []struct { @@ -425,7 +425,7 @@ func loadTestFixture(cli *elasticsearch.Client, esClient *store.Client, filePath ctx := context.TODO() for _, testdata := range data { - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) for _, ast := range testdata.Assets { if err := repo.Upsert(ctx, ast); err != nil { return err @@ -453,7 +453,7 @@ func TestGroupAssets(t *testing.T) { ) require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) _, err = repo.GroupAssets(ctx, asset.GroupConfig{ GroupBy: []string{""}, }) @@ -474,7 +474,7 @@ func TestGroupAssets(t *testing.T) { err = loadTestFixture(cli, esClient, "./testdata/search-test-fixture.json") require.NoError(t, err) - repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Duration(10)*time.Second) + repo := store.NewDiscoveryRepository(esClient, log.NewNoop(), time.Second*10) type groupTest struct { Description string