testSyncCmd is a test helper that sets up a test environment, runs setup, syncs, and asserts
(t *testing.T, fullSync bool, setup setupFunc, assert assertFunc)
| 244 | |
| 245 | // testSyncCmd is a test helper that sets up a test environment, runs setup, syncs, and asserts |
| 246 | func testSyncCmd(t *testing.T, fullSync bool, setup setupFunc, assert assertFunc) { |
| 247 | env := setupTestEnv(t) |
| 248 | |
| 249 | user := setupUserAndLogin(t, env) |
| 250 | ids := setup(t, env, user) |
| 251 | |
| 252 | if fullSync { |
| 253 | clitest.RunDnoteCmd(t, env.CmdOpts, cliBinaryName, "sync", "-f") |
| 254 | } else { |
| 255 | clitest.RunDnoteCmd(t, env.CmdOpts, cliBinaryName, "sync") |
| 256 | } |
| 257 | |
| 258 | assert(t, env, user, ids) |
| 259 | } |
| 260 | |
| 261 | // systemState represents the expected state of the sync system |
| 262 | type systemState struct { |