| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Test.Migration.User
Contents
Description
The migration has these phases. 1. Write to cassandra (before any migration activity) 2. Galley is prepared for migrations (new things created in PG, old things are in Cassandra) 3. Backgound worker starts migration 4. Background worker finishes migration, galley is still configured to think migration is on going 5. Background worker is configured to not do anything, galley is configured to only use PG
The comments and variable names call these phases by number i.e. Phase1, Phase2, and so on.
The tests are from the perspective of mel, a user on the dynamic backend, called backendM (migrating backend). There are also users called mark and mia on this backend.
Synopsis
- testUserMigrationToPostgres :: App ()
- testReindexingUsersDuringMigration :: HasCallStack => App ()
- testMigrationOfUsersWithHandleDisputes :: HasCallStack => App ()
- testMigrationOfInvalidUsers :: HasCallStack => App ()
- data TestUsersByOperations = TestUsersByOperations {}
- data TestUserList = TestUserList {
- scimUsersWithRichInfo :: TestScimUsers
- scimUsersWithoutRichInfo :: TestScimUsers
- pendingScimUsers :: TestScimUsers
- ssoUsers :: TestTeamUsers
- passwordTeamUsers :: TestTeamUsers
- personalUsersWithoutHandle :: Map String (Value, Maybe String)
- personalUsersWithHandle :: Map String (Value, Maybe String)
- botsInTeamConvs :: TestTeamUsers
- botsInPersonalConvs :: Map String (Value, Value)
- data TestScimUsers = TestScimUsers {}
- data TestTeamUsers = TestTeamUsers {}
- data UserUpdate
- arbitraryNonPasswordUpdate :: Gen UserUpdate
- data PendingScimUpdate
- data PhaseUpdates = PhaseUpdates {}
- arbitraryPhaseUpdates :: Int -> Gen PhaseUpdates
- userMigrationFinishedCounterName :: String
- commonOverrides :: ServiceOverrides
- phase1Overrides :: ServiceOverrides
- phase2Overrides :: ServiceOverrides
- phase3Overrides :: ServiceOverrides
- phase4Overrides :: ServiceOverrides
- phase5Overrides :: ServiceOverrides
- phaseOverrides :: IntMap ServiceOverrides
Documentation
testReindexingUsersDuringMigration :: HasCallStack => App () Source #
This test creates users in PG and Cassandra separately to simulate a situation where there are users in both DBs. Then tries to index them into ES to make sure the pagination over these users works.
testMigrationOfInvalidUsers :: HasCallStack => App () Source #
Test Helpers
data TestUsersByOperations Source #
Constructors
| TestUsersByOperations | |
Fields | |
Instances
data TestUserList Source #
Constructors
| TestUserList | |
Fields
| |
Instances
| ToJSON TestUserList Source # | |
Defined in Test.Migration.User Methods toJSON :: TestUserList -> Value Source # toEncoding :: TestUserList -> Encoding Source # toJSONList :: [TestUserList] -> Value Source # toEncodingList :: [TestUserList] -> Encoding Source # omitField :: TestUserList -> Bool Source # | |
| Show TestUserList Source # | |
Defined in Test.Migration.User Methods showsPrec :: Int -> TestUserList -> ShowS # show :: TestUserList -> String # showList :: [TestUserList] -> ShowS # | |
| Eq TestUserList Source # | |
Defined in Test.Migration.User | |
data TestScimUsers Source #
Constructors
| TestScimUsers | |
Instances
| Show TestScimUsers Source # | |
Defined in Test.Migration.User Methods showsPrec :: Int -> TestScimUsers -> ShowS # show :: TestScimUsers -> String # showList :: [TestScimUsers] -> ShowS # | |
| Eq TestScimUsers Source # | |
Defined in Test.Migration.User Methods (==) :: TestScimUsers -> TestScimUsers -> Bool # (/=) :: TestScimUsers -> TestScimUsers -> Bool # | |
data TestTeamUsers Source #
Constructors
| TestTeamUsers | |
Instances
| Show TestTeamUsers Source # | |
Defined in Test.Migration.User Methods showsPrec :: Int -> TestTeamUsers -> ShowS # show :: TestTeamUsers -> String # showList :: [TestTeamUsers] -> ShowS # | |
| Eq TestTeamUsers Source # | |
Defined in Test.Migration.User Methods (==) :: TestTeamUsers -> TestTeamUsers -> Bool # (/=) :: TestTeamUsers -> TestTeamUsers -> Bool # | |
data UserUpdate Source #
Constructors
| UpdateName String | |
| UpdateHandle String | |
| UpdateEmail String | |
| UpdatePassword String |
Instances
| Arbitrary UserUpdate Source # | |||||
Defined in Test.Migration.User | |||||
| ToJSON UserUpdate Source # | |||||
Defined in Test.Migration.User Methods toJSON :: UserUpdate -> Value Source # toEncoding :: UserUpdate -> Encoding Source # toJSONList :: [UserUpdate] -> Value Source # toEncodingList :: [UserUpdate] -> Encoding Source # omitField :: UserUpdate -> Bool Source # | |||||
| Generic UserUpdate Source # | |||||
Defined in Test.Migration.User Associated Types
| |||||
| Show UserUpdate Source # | |||||
Defined in Test.Migration.User Methods showsPrec :: Int -> UserUpdate -> ShowS # show :: UserUpdate -> String # showList :: [UserUpdate] -> ShowS # | |||||
| Eq UserUpdate Source # | |||||
Defined in Test.Migration.User | |||||
| type Rep UserUpdate Source # | |||||
Defined in Test.Migration.User type Rep UserUpdate = D1 ('MetaData "UserUpdate" "Test.Migration.User" "integration-0.1.0-LAqLhzD715GJRPCTI43fmr" 'False) ((C1 ('MetaCons "UpdateName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "UpdateHandle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) :+: (C1 ('MetaCons "UpdateEmail" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "UpdatePassword" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) | |||||
data PendingScimUpdate Source #
Constructors
| RegisterPendingScimUser | |
| UpdatePendingScimUser UserUpdate |
Instances
| Arbitrary PendingScimUpdate Source # | |||||
Defined in Test.Migration.User Methods arbitrary :: Gen PendingScimUpdate Source # shrink :: PendingScimUpdate -> [PendingScimUpdate] Source # | |||||
| ToJSON PendingScimUpdate Source # | |||||
Defined in Test.Migration.User Methods toJSON :: PendingScimUpdate -> Value Source # toEncoding :: PendingScimUpdate -> Encoding Source # toJSONList :: [PendingScimUpdate] -> Value Source # toEncodingList :: [PendingScimUpdate] -> Encoding Source # omitField :: PendingScimUpdate -> Bool Source # | |||||
| Generic PendingScimUpdate Source # | |||||
Defined in Test.Migration.User Associated Types
Methods from :: PendingScimUpdate -> Rep PendingScimUpdate x # to :: Rep PendingScimUpdate x -> PendingScimUpdate # | |||||
| Show PendingScimUpdate Source # | |||||
Defined in Test.Migration.User Methods showsPrec :: Int -> PendingScimUpdate -> ShowS # show :: PendingScimUpdate -> String # showList :: [PendingScimUpdate] -> ShowS # | |||||
| Eq PendingScimUpdate Source # | |||||
Defined in Test.Migration.User Methods (==) :: PendingScimUpdate -> PendingScimUpdate -> Bool # (/=) :: PendingScimUpdate -> PendingScimUpdate -> Bool # | |||||
| type Rep PendingScimUpdate Source # | |||||
Defined in Test.Migration.User type Rep PendingScimUpdate = D1 ('MetaData "PendingScimUpdate" "Test.Migration.User" "integration-0.1.0-LAqLhzD715GJRPCTI43fmr" 'False) (C1 ('MetaCons "RegisterPendingScimUser" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "UpdatePendingScimUser" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UserUpdate))) | |||||
data PhaseUpdates Source #
Constructors
| PhaseUpdates | |
Fields | |
Instances
| ToJSON PhaseUpdates Source # | |||||
Defined in Test.Migration.User Methods toJSON :: PhaseUpdates -> Value Source # toEncoding :: PhaseUpdates -> Encoding Source # toJSONList :: [PhaseUpdates] -> Value Source # toEncodingList :: [PhaseUpdates] -> Encoding Source # omitField :: PhaseUpdates -> Bool Source # | |||||
| Generic PhaseUpdates Source # | |||||
Defined in Test.Migration.User Associated Types
| |||||
| Show PhaseUpdates Source # | |||||
Defined in Test.Migration.User Methods showsPrec :: Int -> PhaseUpdates -> ShowS # show :: PhaseUpdates -> String # showList :: [PhaseUpdates] -> ShowS # | |||||
| Eq PhaseUpdates Source # | |||||
Defined in Test.Migration.User | |||||
| type Rep PhaseUpdates Source # | |||||
Defined in Test.Migration.User type Rep PhaseUpdates = D1 ('MetaData "PhaseUpdates" "Test.Migration.User" "integration-0.1.0-LAqLhzD715GJRPCTI43fmr" 'False) (C1 ('MetaCons "PhaseUpdates" 'PrefixI 'True) ((S1 ('MetaSel ('Just "scimUsersWithRichInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [UserUpdate]) :*: (S1 ('MetaSel ('Just "scimUsersWithoutRichInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [UserUpdate]) :*: S1 ('MetaSel ('Just "pendingScimUsers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PendingScimUpdate]))) :*: ((S1 ('MetaSel ('Just "ssoUsers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [UserUpdate]) :*: S1 ('MetaSel ('Just "passwordTeamUsers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [UserUpdate])) :*: (S1 ('MetaSel ('Just "personalUsersWithoutHandle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [UserUpdate]) :*: S1 ('MetaSel ('Just "personalUsersWithHandle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [UserUpdate]))))) | |||||