Group configuration by component ownership
This commit is contained in:
parent
48a5b8a433
commit
67cc0cb802
1 changed files with 486 additions and 258 deletions
|
|
@ -8,7 +8,7 @@ import qualified Data.ByteString.Base16 as B16
|
|||
import qualified Data.Text as Text
|
||||
import qualified Data.Text.Encoding as TextEncoding
|
||||
import Database.PostgreSQL.Simple (Only (..))
|
||||
import Nuthatch.Config (loadConfig)
|
||||
import Nuthatch.Config (Config (..), loadConfig)
|
||||
import qualified Nuthatch.Db as Db
|
||||
import Nuthatch.Probe.Assert
|
||||
import Nuthatch.Probe.Curl
|
||||
|
|
@ -27,14 +27,14 @@ main = do
|
|||
setEnv "NUTHATCH_OIDC_CLIENT_SECRET" "synthetic-fixture-client-secret"
|
||||
config <- loadConfig
|
||||
verifyProfileFile profile lane pgConnection
|
||||
Db.withDb config $ \database -> do
|
||||
Db.withDb (cfgPostgres config) $ \database -> do
|
||||
_ <- Db.execute_ database
|
||||
"CREATE TEMP TABLE lane_canary (value text NOT NULL)"
|
||||
_ <- Db.execute database
|
||||
"INSERT INTO lane_canary VALUES (?)"
|
||||
(Only (Text.pack profile))
|
||||
pure ()
|
||||
withRedis config $ \redis -> do
|
||||
withRedis (cfgRedis config) $ \redis -> do
|
||||
cacheSet redis "lane-canary" 60 (B8.pack profile)
|
||||
cacheGet redis "lane-canary" >>=
|
||||
assertEqual "coordination lane canary" (Just (B8.pack profile))
|
||||
|
|
@ -42,7 +42,7 @@ main = do
|
|||
discovery <- curl [issuer <> "/.well-known/openid-configuration"]
|
||||
assertEqual "OIDC discovery status" 200 (curlStatus discovery)
|
||||
assertContains "OIDC discovery issuer" "\"issuer\"" (curlBody discovery)
|
||||
store <- newS3 config
|
||||
store <- newS3 (cfgS3 config)
|
||||
let key = ObjectKey "lane-canary"
|
||||
body = BL.fromStrict (B8.pack profile)
|
||||
digest =
|
||||
|
|
|
|||
Loading…
Reference in a new issue