MCPcopy
hub / github.com/rclone/rclone / TestSyncIgnoreErrors

Function TestSyncIgnoreErrors

fs/sync/sync_test.go:943–1005  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

941}
942
943func TestSyncIgnoreErrors(t *testing.T) {
944 ctx := context.Background()
945 ctx, ci := fs.AddConfig(ctx)
946 r := fstest.NewRun(t)
947 ci.IgnoreErrors = true
948 file1 := r.WriteFile("a/potato2", "------------------------------------------------------------", t1)
949 file2 := r.WriteObject(ctx, "b/potato", "SMALLER BUT SAME DATE", t2)
950 file3 := r.WriteBoth(ctx, "c/non empty space", "AhHa!", t2)
951 require.NoError(t, operations.Mkdir(ctx, r.Fremote, "d"))
952
953 r.CheckLocalListing(
954 t,
955 []fstest.Item{
956 file1,
957 file3,
958 },
959 []string{
960 "a",
961 "c",
962 },
963 )
964 r.CheckRemoteListing(
965 t,
966 []fstest.Item{
967 file2,
968 file3,
969 },
970 []string{
971 "b",
972 "c",
973 "d",
974 },
975 )
976
977 accounting.GlobalStats().ResetCounters()
978 ctx = predictDstFromLogger(ctx)
979 _ = fs.CountError(ctx, errors.New("boom"))
980 assert.NoError(t, Sync(ctx, r.Fremote, r.Flocal, false))
981 testLoggerVsLsf(ctx, r.Fremote, r.Flocal, operations.GetLoggerOpt(ctx).JSON, t)
982
983 r.CheckLocalListing(
984 t,
985 []fstest.Item{
986 file1,
987 file3,
988 },
989 []string{
990 "a",
991 "c",
992 },
993 )
994 r.CheckRemoteListing(
995 t,
996 []fstest.Item{
997 file1,
998 file3,
999 },
1000 []string{

Callers

nothing calls this directly

Calls 14

WriteFileMethod · 0.95
WriteObjectMethod · 0.95
WriteBothMethod · 0.95
CheckLocalListingMethod · 0.95
CheckRemoteListingMethod · 0.95
AddConfigFunction · 0.92
NewRunFunction · 0.92
MkdirFunction · 0.92
GlobalStatsFunction · 0.92
GetLoggerOptFunction · 0.92
predictDstFromLoggerFunction · 0.85
SyncFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…