integration-0.1.0
Safe HaskellNone
LanguageGHC2021

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

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.

Test Helpers

data TestUsersByOperations Source #

Instances

Instances details
ToJSON TestUsersByOperations Source # 
Instance details

Defined in Test.Migration.User

Monoid TestUsersByOperations Source # 
Instance details

Defined in Test.Migration.User

Semigroup TestUsersByOperations Source # 
Instance details

Defined in Test.Migration.User

Generic TestUsersByOperations Source # 
Instance details

Defined in Test.Migration.User

Associated Types

type Rep TestUsersByOperations 
Instance details

Defined in Test.Migration.User

type Rep TestUsersByOperations = D1 ('MetaData "TestUsersByOperations" "Test.Migration.User" "integration-0.1.0-LAqLhzD715GJRPCTI43fmr" 'False) (C1 ('MetaCons "TestUsersByOperations" 'PrefixI 'True) (S1 ('MetaSel ('Just "updates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IntMap TestUserList)) :*: S1 ('MetaSel ('Just "deletes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IntMap TestUserList))))
Show TestUsersByOperations Source # 
Instance details

Defined in Test.Migration.User

Eq TestUsersByOperations Source # 
Instance details

Defined in Test.Migration.User

type Rep TestUsersByOperations Source # 
Instance details

Defined in Test.Migration.User

type Rep TestUsersByOperations = D1 ('MetaData "TestUsersByOperations" "Test.Migration.User" "integration-0.1.0-LAqLhzD715GJRPCTI43fmr" 'False) (C1 ('MetaCons "TestUsersByOperations" 'PrefixI 'True) (S1 ('MetaSel ('Just "updates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IntMap TestUserList)) :*: S1 ('MetaSel ('Just "deletes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (IntMap TestUserList))))

data TestScimUsers Source #

Constructors

TestScimUsers 

Fields

Instances

Instances details
Show TestScimUsers Source # 
Instance details

Defined in Test.Migration.User

Eq TestScimUsers Source # 
Instance details

Defined in Test.Migration.User

data TestTeamUsers Source #

Constructors

TestTeamUsers 

Fields

Instances

Instances details
Show TestTeamUsers Source # 
Instance details

Defined in Test.Migration.User

Eq TestTeamUsers Source # 
Instance details

Defined in Test.Migration.User

data UserUpdate Source #

Instances

Instances details
Arbitrary UserUpdate Source # 
Instance details

Defined in Test.Migration.User

ToJSON UserUpdate Source # 
Instance details

Defined in Test.Migration.User

Generic UserUpdate Source # 
Instance details

Defined in Test.Migration.User

Associated Types

type Rep UserUpdate 
Instance details

Defined in Test.Migration.User

Show UserUpdate Source # 
Instance details

Defined in Test.Migration.User

Eq UserUpdate Source # 
Instance details

Defined in Test.Migration.User

type Rep UserUpdate Source # 
Instance details

Defined in Test.Migration.User

data PendingScimUpdate Source #

Instances

Instances details
Arbitrary PendingScimUpdate Source # 
Instance details

Defined in Test.Migration.User

ToJSON PendingScimUpdate Source # 
Instance details

Defined in Test.Migration.User

Generic PendingScimUpdate Source # 
Instance details

Defined in Test.Migration.User

Associated Types

type Rep PendingScimUpdate 
Instance details

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)))
Show PendingScimUpdate Source # 
Instance details

Defined in Test.Migration.User

Eq PendingScimUpdate Source # 
Instance details

Defined in Test.Migration.User

type Rep PendingScimUpdate Source # 
Instance details

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 #

Instances

Instances details
ToJSON PhaseUpdates Source # 
Instance details

Defined in Test.Migration.User

Generic PhaseUpdates Source # 
Instance details

Defined in Test.Migration.User

Associated Types

type Rep PhaseUpdates 
Instance details

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])))))
Show PhaseUpdates Source # 
Instance details

Defined in Test.Migration.User

Eq PhaseUpdates Source # 
Instance details

Defined in Test.Migration.User

type Rep PhaseUpdates Source # 
Instance details

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])))))