Skip to content

Commit

Permalink
Attempt fixing brig index create tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaymankar committed Apr 23, 2024
1 parent 33acd46 commit 55a5627
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions services/brig/test/integration/Index/Create.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ spec brigOpts =
testCreateIndexWhenNotPresent :: BrigOpts.Opts -> Assertion
testCreateIndexWhenNotPresent brigOpts = do
let (ES.Server esURL) = brigOpts ^. BrigOpts.elasticsearchL . BrigOpts.urlL
let mCreds = BrigOpts.credentials . BrigOpts.elasticsearch $ brigOpts
case parseURI strictURIParserOptions (Text.encodeUtf8 esURL) of
Left e -> fail $ "Invalid ES URL: " <> show esURL <> "\nerror: " <> show e
Right esURI -> do
Expand All @@ -62,9 +61,9 @@ testCreateIndexWhenNotPresent brigOpts = do
ESConnectionSettings
{ esServer = esURI,
esIndex = indexName,
esCaCert = Nothing,
esInsecureSkipVerifyTls = False,
esCredentials = mCreds
esCaCert = brigOpts.elasticsearch.caCert,
esInsecureSkipVerifyTls = brigOpts.elasticsearch.insecureSkipVerifyTls,
esCredentials = brigOpts.elasticsearch.credentials
}
let esSettings =
IndexOpts.localElasticSettings
Expand Down Expand Up @@ -92,7 +91,6 @@ testCreateIndexWhenNotPresent brigOpts = do
testCreateIndexWhenPresent :: BrigOpts.Opts -> Assertion
testCreateIndexWhenPresent brigOpts = do
let (ES.Server esURL) = brigOpts ^. BrigOpts.elasticsearchL . BrigOpts.urlL
let mCreds = BrigOpts.credentials . BrigOpts.elasticsearch $ brigOpts
case parseURI strictURIParserOptions (Text.encodeUtf8 esURL) of
Left e -> fail $ "Invalid ES URL: " <> show esURL <> "\nerror: " <> show e
Right esURI -> do
Expand All @@ -111,9 +109,9 @@ testCreateIndexWhenPresent brigOpts = do
ESConnectionSettings
{ esServer = esURI,
esIndex = indexName,
esCaCert = Nothing,
esInsecureSkipVerifyTls = False,
esCredentials = mCreds
esCaCert = brigOpts.elasticsearch.caCert,
esInsecureSkipVerifyTls = brigOpts.elasticsearch.insecureSkipVerifyTls,
esCredentials = brigOpts.elasticsearch.credentials
}
let esSettings =
IndexOpts.localElasticSettings
Expand Down

0 comments on commit 55a5627

Please sign in to comment.