(t *testing.T)
| 1077 | } |
| 1078 | |
| 1079 | func TestMigrateMetadataInvalidSyncData(t *testing.T) { |
| 1080 | base.SetUpTestLogging(t, base.LevelDebug, base.KeyCRUD, base.KeyImport, base.KeyMigrate) |
| 1081 | base.SkipImportTestsIfNotEnabled(t) |
| 1082 | bucket := base.GetTestBucket(t) |
| 1083 | defer bucket.Close(base.TestCtx(t)) |
| 1084 | |
| 1085 | db, ctx := setupTestDBWithOptionsAndImport(t, bucket, DatabaseContextOptions{}) |
| 1086 | defer db.Close(ctx) |
| 1087 | |
| 1088 | doc1ID := t.Name() + "_doc1" |
| 1089 | doc2ID := t.Name() + "_doc2" |
| 1090 | |
| 1091 | collection, _ := GetSingleDatabaseCollectionWithUser(ctx, t, db) |
| 1092 | |
| 1093 | // create a docs with invalid sync data |
| 1094 | _, err := collection.dataStore.Add(doc1ID, 0, []byte(`{"some": "data", "_sync": {}}`)) |
| 1095 | require.NoError(t, err) |
| 1096 | _, err = collection.dataStore.Add(doc2ID, 0, []byte(`{"some": "data", "_sync": {"rev": "1-cd809becc169215072fd567eebd8b8de","sequence": 1,"recent_sequences": [1],"history": {},"cas": "","time_saved": "2017-11-29T12:46:13.456631-08:00"}}`)) |
| 1097 | require.NoError(t, err) |
| 1098 | |
| 1099 | base.RequireWaitForStat(t, func() int64 { |
| 1100 | return db.DbStats.SharedBucketImport().ImportErrorCount.Value() |
| 1101 | }, 2) |
| 1102 | } |
| 1103 | |
| 1104 | func TestImportFeedNonJSONNewDoc(t *testing.T) { |
| 1105 | base.SetUpTestLogging(t, base.LevelDebug, base.KeyMigrate, base.KeyImport) |
nothing calls this directly
no test coverage detected