Sync Function Tester

I created a Sync Function tester script to test your sync function easier.

It takes a folder of individual JSON files and GET,PUT and/or DELETE them against your sync gateway to test your sync function.

1 Like

Updated Features

  • Updated the operations Configuration: Added an operations attribute to specify the list of operations to perform.
  • Dynamic Operation Execution: The script now executes operations in the order specified in the operationsarray.
  • Clarified Usage Instructions: Updated the usage instructions to reflect the new configuration options.
  • Admin Operations: Your Sync Function might have certain restrictions at a USER level, but you still need to GET and PUT docs. There are now admin equivalents to the operations.
  • Sleep Operation: Added a new SLEEP operation that allows pausing execution between other operations. This can be useful for testing time-sensitive scenarios or simulating delays.
  • HTTP GET /_raw/{docId}: Added a new GET_RAW operation that allows you to get the document from Sync Gateway exactly how it is stored in Couchbase Server includes all the meta / bookkeeping data from _sync.
  • Scopes and Collection: In the config.json just pass in non-default(_default) value for sgDbScope and sgDbCollection to test scopes and collection Sync Functions.