Test with multiple CompareDest
(t *testing.T)
| 2225 | |
| 2226 | // Test with multiple CompareDest |
| 2227 | func TestSyncMultipleCompareDest(t *testing.T) { |
| 2228 | ctx := context.Background() |
| 2229 | ctx, ci := fs.AddConfig(ctx) |
| 2230 | r := fstest.NewRun(t) |
| 2231 | precision := fs.GetModifyWindow(ctx, r.Fremote, r.Flocal) |
| 2232 | |
| 2233 | ci.CompareDest = []string{r.FremoteName + "/pre-dest1", r.FremoteName + "/pre-dest2"} |
| 2234 | |
| 2235 | // check empty dest, new compare |
| 2236 | fsrc1 := r.WriteFile("1", "1", t1) |
| 2237 | fsrc2 := r.WriteFile("2", "2", t1) |
| 2238 | fsrc3 := r.WriteFile("3", "3", t1) |
| 2239 | r.CheckLocalItems(t, fsrc1, fsrc2, fsrc3) |
| 2240 | |
| 2241 | fdest1 := r.WriteObject(ctx, "pre-dest1/1", "1", t1) |
| 2242 | fdest2 := r.WriteObject(ctx, "pre-dest2/2", "2", t1) |
| 2243 | r.CheckRemoteItems(t, fdest1, fdest2) |
| 2244 | |
| 2245 | accounting.GlobalStats().ResetCounters() |
| 2246 | fdst, err := fs.NewFs(ctx, r.FremoteName+"/dest") |
| 2247 | require.NoError(t, err) |
| 2248 | // ctx = predictDstFromLogger(ctx) |
| 2249 | require.NoError(t, Sync(ctx, fdst, r.Flocal, false)) |
| 2250 | // testLoggerVsLsf(ctx, fdst, operations.GetLoggerOpt(ctx).JSON, t) |
| 2251 | |
| 2252 | fdest3 := fsrc3 |
| 2253 | fdest3.Path = "dest/3" |
| 2254 | |
| 2255 | fstest.CheckItemsWithPrecision(t, fdst, precision, fsrc3) |
| 2256 | r.CheckRemoteItems(t, fdest1, fdest2, fdest3) |
| 2257 | } |
| 2258 | |
| 2259 | // Test with CopyDest set |
| 2260 | func TestSyncCopyDest(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…