fix(avs): fix tests (do not exit with failure on empty avs config)
This commit is contained in:
parent
e03282fedd
commit
89aff47152
@ -345,14 +345,14 @@ makeFoundation appSettings''@AppSettings{..} = do
|
|||||||
handleIf isBucketExists (const $ return ()) $ Minio.makeBucket appUploadTmpBucket Nothing
|
handleIf isBucketExists (const $ return ()) $ Minio.makeBucket appUploadTmpBucket Nothing
|
||||||
return conn
|
return conn
|
||||||
|
|
||||||
appAvsQuery <- do
|
appAvsQuery <- case appAvsConf of
|
||||||
manager <- newManagerSettings $ mkManagerSettings (def { settingDisableCertificateValidation = True }) Nothing
|
|
||||||
case appAvsConf of
|
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
$logErrorS "avsPrepare" "appAvsConfig is empty, i.e. invalid AVS configuration settings."
|
$logErrorS "avsPrepare" "appAvsConfig is empty, i.e. invalid AVS configuration settings."
|
||||||
liftIO exitFailure
|
return Nothing
|
||||||
|
-- liftIO exitFailure
|
||||||
Just avsConf -> do
|
Just avsConf -> do
|
||||||
-- TODO: consider using Servant.Client.Core.BaseUrl.Instances.parseBaseUrl' within Settings already at Startup!
|
-- TODO: consider using Servant.Client.Core.BaseUrl.Instances.parseBaseUrl' within Settings already at Startup!
|
||||||
|
manager <- newManagerSettings $ mkManagerSettings (def { settingDisableCertificateValidation = True }) Nothing
|
||||||
let avsServer = BaseUrl
|
let avsServer = BaseUrl
|
||||||
{ baseUrlScheme = Https
|
{ baseUrlScheme = Https
|
||||||
, baseUrlHost = avsHost avsConf
|
, baseUrlHost = avsHost avsConf
|
||||||
@ -365,7 +365,7 @@ makeFoundation appSettings''@AppSettings{..} = do
|
|||||||
}
|
}
|
||||||
(avsPersonSearch :<|> avsPersonStatus) = client avsApi avsAuth
|
(avsPersonSearch :<|> avsPersonStatus) = client avsApi avsAuth
|
||||||
runQuery query = runClientM query $ mkClientEnv manager avsServer
|
runQuery query = runClientM query $ mkClientEnv manager avsServer
|
||||||
return AvsQuery
|
return $ Just AvsQuery
|
||||||
{ avsQueryPerson = liftIO . runQuery . avsPersonSearch
|
{ avsQueryPerson = liftIO . runQuery . avsPersonSearch
|
||||||
, avsQueryStatus = liftIO . runQuery . avsPersonStatus
|
, avsQueryStatus = liftIO . runQuery . avsPersonStatus
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,7 @@ data UniWorX = UniWorX
|
|||||||
, appPersonalisedSheetFilesSeedKey :: PersonalisedSheetFilesSeedKey
|
, appPersonalisedSheetFilesSeedKey :: PersonalisedSheetFilesSeedKey
|
||||||
, appVolatileClusterSettingsCache :: TVar VolatileClusterSettingsCache
|
, appVolatileClusterSettingsCache :: TVar VolatileClusterSettingsCache
|
||||||
, appStartTime :: UTCTime -- for Status Page
|
, appStartTime :: UTCTime -- for Status Page
|
||||||
, appAvsQuery :: AvsQuery
|
, appAvsQuery :: Maybe AvsQuery
|
||||||
} deriving (Typeable)
|
} deriving (Typeable)
|
||||||
|
|
||||||
makeLenses_ ''UniWorX
|
makeLenses_ ''UniWorX
|
||||||
|
|||||||
@ -54,8 +54,10 @@ validateAvsStatusQuery = do
|
|||||||
getAdminAvsR, postAdminAvsR :: Handler Html
|
getAdminAvsR, postAdminAvsR :: Handler Html
|
||||||
getAdminAvsR = postAdminAvsR
|
getAdminAvsR = postAdminAvsR
|
||||||
postAdminAvsR = do
|
postAdminAvsR = do
|
||||||
AvsQuery{..} <- getsYesod $ view _appAvsQuery
|
mAvsQuery <- getsYesod $ view _appAvsQuery
|
||||||
|
case mAvsQuery of
|
||||||
|
Nothing -> return mempty
|
||||||
|
Just AvsQuery{..} -> do
|
||||||
((presult, pwidget), penctype) <- runFormPost $ makeAvsPersonForm Nothing
|
((presult, pwidget), penctype) <- runFormPost $ makeAvsPersonForm Nothing
|
||||||
|
|
||||||
let procFormPerson fr = do
|
let procFormPerson fr = do
|
||||||
|
|||||||
Reference in New Issue
Block a user