Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring of persistence unit tests (cadence-workflow#1111)
* Implement metadata persistence in SQL This implementation (sqlMetadataPersistence.go) implements the following "v2" MetadataManager interface: - CreateDomain - GetDomain - UpdateDomain - DeleteDomain - DeleteDomainByName - ListDomain - GetMetadata The test creates and deletes the table in "sql/domains.sql" by itself. You just need to stand up a MySQL instance with a databased named "catalyst_test". At the moment everything is hardcoded to use uber:uber@localhost:3306 with database "catalyst_test". This should be generalized. * Test GetDomain with blank id and name (cadence-workflow#2) * Big rename (cadence-workflow#3) Put Cassandra and SQL implementations and the common tests into separate packages under `persistence` * Shard persistence, some executions persistence (cadence-workflow#4) * Pass TestPersistenceStartWorkflow, TestGetWorkflow, TestCreateGetUpdateGetShard * Moved SQL scripts into one file * Pass some more tests (cadence-workflow#5) * Pass TestUpdateWorkflow * Pass TestGetCurrentWorkflow * Pass TestPersistenceStartWorkflowWithReplicationState Perturb test slightly to force ShardOwnershipLost instead of WorkflowAlredyExists * Pass TestDeleteWorkflow * TestTransferTasksThroughUpdate * Pass TestCancelTransferTaskTasks * Pass TestSignalTransferTaskTasks, TestCreateTask * Pass TestLeaseAndUpdateTaskList * add stubs * Put transferTaskTypeTransferTargetRunID back in cassandra; remove superfluous WHERE conditions * More readable variable names * Add error if getTaskList fails with error other than errNoRows * Add field names for struct literals * Add logger member to task persistence so we can panic, like the Cassandra impl does * typo: forgot to add logger argument after adding logger parameter to constructor * TestLeaseAndUpdateTaskList_Sticky, TestGetDecisionTasks, TestComplete… (cadence-workflow#7) * TestLeaseAndUpdateTaskList_Sticky, TestGetDecisionTasks, TestCompleteDecisionTask, TestReplicationTasks, TestTimerTasks * Add & to struct arguments for named SQL queries * Add error handling on type casts. This causes one of the tests to stop panicking * ContinueAsNew == Squashed commit of the following: commit 7a626d9 Author: Quincy Lam <[email protected]> Date: Mon Jul 30 19:20:19 2018 -0700 Delete panics commit 14cb2c3 Author: Quincy Lam <[email protected]> Date: Mon Jul 30 19:17:51 2018 -0700 Pass commit 04ae7b9 Author: Quincy Lam <[email protected]> Date: Mon Jul 30 17:33:03 2018 -0700 almost * TestCreateGetShard_Backfill Squashed commit of the following: commit 05b0ddd Author: Quincy Lam <[email protected]> Date: Mon Jul 30 21:12:40 2018 -0700 Pass * TestWorkflowReplicationState Squashed commit of the following: commit 5ac28b4 Author: Quincy Lam <[email protected]> Date: Tue Jul 31 13:48:09 2018 -0700 Pass * History persistence Squashed commit of the following: commit a86050e Author: Quincy Lam <[email protected]> Date: Thu Aug 2 14:38:16 2018 -0700 use error message to inspect duplicate key insert failure commit d60de82 Author: Quincy Lam <[email protected]> Date: Thu Aug 2 14:13:50 2018 -0700 reorder imports commit 774fe2a Author: Quincy Lam <[email protected]> Date: Thu Aug 2 14:10:34 2018 -0700 Const queries commit da7ab8d Author: Quincy Lam <[email protected]> Date: Wed Aug 1 22:15:27 2018 -0700 Pass TestDeleteHistoryEvents commit c2978a2 Author: Quincy Lam <[email protected]> Date: Wed Aug 1 22:07:33 2018 -0700 Pass TestGetHistoryEvents, TestGetHistoryEventsCompatibility commit c775b53 Author: Quincy Lam <[email protected]> Date: Wed Aug 1 21:44:27 2018 -0700 TestAppendHistoryEvents * Mutable state; fixed possible regression with TestWorkflowReplicationState Squashed commit of the following: commit a0f75b1 Author: Quincy Lam <[email protected]> Date: Fri Aug 3 01:25:43 2018 -0700 Pass TestResetMutableState commit ef41d12 Author: Quincy Lam <[email protected]> Date: Thu Aug 2 23:51:13 2018 -0700 Fix regression with GetWorkflow (need to check if execution row exists before locking it; otherwise return EntityNotExists in order to pass DeleteWorkflow test) commit fd485d9 Author: Quincy Lam <[email protected]> Date: Thu Aug 2 23:35:35 2018 -0700 Pass TestWorkflowMutableState_SignalRequested commit d0a2c79 Author: Quincy Lam <[email protected]> Date: Thu Aug 2 22:35:26 2018 -0700 Pass TestWorkflowMutableState_BufferedReplicationTasks commit 6d220db Author: Quincy Lam <[email protected]> Date: Thu Aug 2 21:47:22 2018 -0700 Pass TestWorkflowMutableState_SignalInfo commit 2115127 Author: Quincy Lam <[email protected]> Date: Thu Aug 2 21:17:00 2018 -0700 Request cancel info commit 79733c2 Author: Quincy Lam <[email protected]> Date: Thu Aug 2 20:42:49 2018 -0700 parent executions; TestWorkflowMutableState_ChildExecutions commit 2751bf1 Author: Quincy Lam <[email protected]> Date: Thu Aug 2 18:02:54 2018 -0700 Pass TestWorkflowMutableState_Timers commit 72b99de Author: Quincy Lam <[email protected]> Date: Thu Aug 2 16:08:56 2018 -0700 Make some better query templates commit 6ec3532 Author: Quincy Lam <[email protected]> Date: Tue Jul 31 23:11:47 2018 -0700 Pass TestWorkflowMutableState_Activities * go fmt, rename GetVisilibityTS * Add branches with sql stuff * deleted and rebuilt glide.lock * typos with the branches * Add metadata switch * Add history branch * Pass shard persistence tests * hello world with sql executions+metadata+history+shards works * Some debugging prompts * childworkflow works The bug was that createTimerTasks within ContinueAsNew logic was being caled on the transfer tasks. THere should be a test to make sure this typo doesn't occur * Added MapperFunc to sql db field mapping * Fixed syntax errors * Moved from hmgle/sqlx to jmoiron/sqlx with batch update patch * Renamed TestBase.CassandraTestCluster to PersistenceTestCluster * Refactored persistence unit tests to support shared tests for various backends * Renamed TestBaseOptions.Cluster... to DB... * IUpdated CassandraTestCluster methods to more generic names * Refactored cassandra test initialization out of persistence-tests * Removed SQL implementation * Linter fixes * Removed config changes * Renamed persistence to p prefix * Renamed persistence to p prefix in cassandra package * Renamed persistence to p prefix in service packages * PR comments * Added InitTestSuiteWithMetadata and fixed Integration_domain_failover_test
- Loading branch information