Skip to content

Commit

Permalink
[stash]
Browse files Browse the repository at this point in the history
  • Loading branch information
fisx committed Sep 15, 2023
1 parent f7c3879 commit 7b0aded
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions integration/test/SetupHelpers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ getAllConvs u = do
resp.json
result %. "found" & asList

runCqlCommand :: String -> App ()
runCqlCommand cmd =
-- docker ps | grep '/cassandra:' | perl -ne '/^(\S+)\s/ && print $1'
void . liftIO . system $ "echo " <> show cmd <> " | docker exec -i c85ecd25a7f7 /usr/bin/cqlsh"

deleteFedConn :: (HasCallStack, MakesValue tablespace, MakesValue otherdom) => tablespace -> otherdom -> App ()
deleteFedConn mktab mkother = do
tablespace <- asString mktab
Expand Down
4 changes: 3 additions & 1 deletion integration/test/Test/Brig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import API.Brig qualified as Public
import API.BrigInternal qualified as Internal
import API.Common qualified as API
import API.GalleyInternal qualified as Internal
import Control.Concurrent (threadDelay)
import Data.Aeson qualified as Aeson
import Data.Aeson.Types hiding ((.=))
import Data.Set qualified as Set
Expand Down Expand Up @@ -63,8 +64,9 @@ testCrudFederationRemotes = do
cfgRemotesExpect = Internal.FedConn (cs otherDomain) "full_search"

resetFedConns ownDomain
liftIO $ threadDelay 5_000_000
cfgRemotes <- parseFedConns =<< Internal.readFedConns ownDomain
sort cfgRemotes `shouldMatch` ([] @Value)
cfgRemotes `shouldMatch` ([] @Value)
-- entries present in the config file can be idempotently added if identical, but cannot be
-- updated.
addOnce cfgRemotesExpect [cfgRemotesExpect]
Expand Down
3 changes: 2 additions & 1 deletion integration/test/Test/Conversation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ testDefederationGroupConversation = do
-- assert conversation deleted from domainA
retryT $
bindResponse (getConversation uA convId) $ \r ->
r.status `shouldMatchInt` 404
r.status `shouldMatchInt` 422

-- assert no conversation.delete event is sent to uA
eventPayloads <-
Expand Down Expand Up @@ -251,6 +251,7 @@ testAddMembersNonFullyConnectedProteus = do
liftIO $ threadDelay (2 * 1000 * 1000) -- wait for federation status to be updated
-- add members from remote backends
members <- for [u2, u3] (%. "qualified_id")
liftIO $ threadDelay 5_000_000
bindResponse (addMembers u1 cid members) $ \resp -> do
resp.status `shouldMatchInt` 409
resp.json %. "non_federating_backends" `shouldMatchSet` [domainB, domainC]
Expand Down
2 changes: 1 addition & 1 deletion integration/test/Test/Federation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ testNotificationsForOfflineBackends = do
isDelUserLeaveUpConvNotif = allPreds [isConvLeaveNotif, isNotifConv upBackendConv, isNotifForUser delUser]

do
newMsgNotif <- awaitNotification otherUser otherClient noValue 1 isNewMessageNotif
newMsgNotif <- awaitNotification otherUser otherClient noValue 1 isNewMessageNotif -- ! this fails locally, but why?
newMsgNotif %. "payload.0.qualified_conversation" `shouldMatch` objQidObject upBackendConv
newMsgNotif %. "payload.0.data.text" `shouldMatchBase64` "success message for other user"

Expand Down

0 comments on commit 7b0aded

Please sign in to comment.