@@ -505,18 +505,8 @@ func TestTouchCASSemantics(t *testing.T) {
505505 require .NotEqual (t , getTouchCAS , clearTouchCAS , "Touch should bump CAS when clearing TTL" )
506506}
507507
508- func SkipXattrTestsIfNotEnabled (t * testing.T ) {
509-
510- if ! TestUseXattrs () {
511- t .Skip ("XATTR based tests not enabled. Enable via SG_TEST_USE_XATTRS=true environment variable" )
512- }
513- }
514-
515508// TestXattrWriteCasSimple. Validates basic write of document with xattr, and retrieval of the same doc w/ xattr.
516509func TestXattrWriteCasSimple (t * testing.T ) {
517-
518- SkipXattrTestsIfNotEnabled (t )
519-
520510 ctx := TestCtx (t )
521511 bucket := GetTestBucket (t )
522512 defer bucket .Close (ctx )
@@ -582,9 +572,6 @@ func TestXattrWriteCasSimple(t *testing.T) {
582572
583573// TestXattrWriteCasUpsert. Validates basic write of document with xattr, retrieval of the same doc w/ xattr, update of the doc w/ xattr, retrieval of the doc w/ xattr.
584574func TestXattrWriteCasUpsert (t * testing.T ) {
585-
586- SkipXattrTestsIfNotEnabled (t )
587-
588575 ctx := TestCtx (t )
589576 bucket := GetTestBucket (t )
590577 defer bucket .Close (ctx )
@@ -647,9 +634,6 @@ func TestXattrWriteCasUpsert(t *testing.T) {
647634
648635// TestXattrWriteCasWithXattrCasCheck. Validates cas check when using WriteCasWithXattr
649636func TestXattrWriteCasWithXattrCasCheck (t * testing.T ) {
650-
651- SkipXattrTestsIfNotEnabled (t )
652-
653637 ctx := TestCtx (t )
654638 bucket := GetTestBucket (t )
655639 defer bucket .Close (ctx )
@@ -710,8 +694,6 @@ func TestXattrWriteCasWithXattrCasCheck(t *testing.T) {
710694}
711695
712696func TestMultiXattrRoundtrip (t * testing.T ) {
713- SkipXattrTestsIfNotEnabled (t )
714-
715697 ctx := TestCtx (t )
716698 bucket := GetTestBucket (t )
717699 defer bucket .Close (ctx )
@@ -737,9 +719,6 @@ func TestMultiXattrRoundtrip(t *testing.T) {
737719
738720// TestWriteCasXATTRRaw. Validates basic write of document and xattr as raw bytes.
739721func TestXattrWriteCasRaw (t * testing.T ) {
740-
741- SkipXattrTestsIfNotEnabled (t )
742-
743722 ctx := TestCtx (t )
744723 bucket := GetTestBucket (t )
745724 defer bucket .Close (ctx )
@@ -777,13 +756,10 @@ func TestXattrWriteCasRaw(t *testing.T) {
777756
778757// TestWriteCasTombstoneResurrect. Verifies writing a new document body and xattr to a logically deleted document (xattr still exists)
779758func TestXattrWriteCasTombstoneResurrect (t * testing.T ) {
780-
781759 if UnitTestUrlIsWalrus () {
782760 t .Skip ("Test requires Couchbase Server bucket when using xattrs" )
783761 }
784762
785- SkipXattrTestsIfNotEnabled (t )
786-
787763 ctx := TestCtx (t )
788764 bucket := GetTestBucket (t )
789765 defer bucket .Close (ctx )
@@ -847,11 +823,8 @@ func TestXattrWriteCasTombstoneResurrect(t *testing.T) {
847823
848824// TestXattrWriteCasTombstoneUpdate. Validates update of xattr on logically deleted document.
849825func TestXattrWriteCasTombstoneUpdate (t * testing.T ) {
850-
851826 t .Skip ("Test does not pass with errors: https://gist.github.com/tleyden/d261fe2b92bdaaa6e78f9f1c00fdfd58. Needs investigation" )
852827
853- SkipXattrTestsIfNotEnabled (t )
854-
855828 ctx := TestCtx (t )
856829 bucket := GetTestBucket (t )
857830 defer bucket .Close (ctx )
@@ -919,8 +892,6 @@ func TestXattrWriteCasTombstoneUpdate(t *testing.T) {
919892
920893// TestXattrWriteUpdateXattr. Validates basic write of document with xattr, and retrieval of the same doc w/ xattr.
921894func TestXattrWriteUpdateXattr (t * testing.T ) {
922- SkipXattrTestsIfNotEnabled (t )
923-
924895 ctx := TestCtx (t )
925896 bucket := GetTestBucket (t )
926897 defer bucket .Close (ctx )
@@ -1019,8 +990,6 @@ func TestXattrWriteUpdateXattr(t *testing.T) {
1019990}
1020991
1021992func TestWriteUpdateWithXattrUserXattr (t * testing.T ) {
1022- SkipXattrTestsIfNotEnabled (t )
1023-
1024993 ctx := TestCtx (t )
1025994 bucket := GetTestBucket (t )
1026995 defer bucket .Close (ctx )
@@ -1091,8 +1060,6 @@ func TestWriteUpdateWithXattrUserXattr(t *testing.T) {
10911060}
10921061
10931062func TestWriteUpdateDeleteXattr (t * testing.T ) {
1094- SkipXattrTestsIfNotEnabled (t )
1095-
10961063 ctx := TestCtx (t )
10971064 bucket := GetTestBucket (t )
10981065 defer bucket .Close (ctx )
@@ -1128,8 +1095,6 @@ func TestWriteUpdateDeleteXattr(t *testing.T) {
11281095}
11291096
11301097func TestWriteUpdateDeleteXattrTombstone (t * testing.T ) {
1131- SkipXattrTestsIfNotEnabled (t )
1132-
11331098 ctx := TestCtx (t )
11341099 bucket := GetTestBucket (t )
11351100 defer bucket .Close (ctx )
@@ -1156,9 +1121,6 @@ func TestWriteUpdateDeleteXattrTombstone(t *testing.T) {
11561121
11571122// TestXattrDeleteDocument. Delete document that has a system xattr. System XATTR should be retained and retrievable.
11581123func TestXattrDeleteDocument (t * testing.T ) {
1159-
1160- SkipXattrTestsIfNotEnabled (t )
1161-
11621124 ctx := TestCtx (t )
11631125 bucket := GetTestBucket (t )
11641126 defer bucket .Close (ctx )
@@ -1197,9 +1159,6 @@ func TestXattrDeleteDocument(t *testing.T) {
11971159
11981160// TestXattrDeleteDocumentUpdate. Delete a document that has a system xattr along with an xattr update.
11991161func TestXattrDeleteDocumentUpdate (t * testing.T ) {
1200-
1201- SkipXattrTestsIfNotEnabled (t )
1202-
12031162 ctx := TestCtx (t )
12041163 bucket := GetTestBucket (t )
12051164 defer bucket .Close (ctx )
@@ -1302,9 +1261,6 @@ func TestXattrDeleteDocumentAndUpdateXattr(t *testing.T) {
13021261
13031262// Validates tombstone of doc + xattr in a matrix of various possible previous states of the document.
13041263func TestXattrTombstoneDocAndUpdateXattr (t * testing.T ) {
1305-
1306- SkipXattrTestsIfNotEnabled (t )
1307-
13081264 SetUpTestLogging (t , LevelDebug , KeyCRUD )
13091265
13101266 ctx := TestCtx (t )
@@ -1411,9 +1367,6 @@ func TestXattrTombstoneDocAndUpdateXattr(t *testing.T) {
14111367
14121368// Validates deletion of doc + xattr in a matrix of various possible previous states of the document.
14131369func TestXattrDeleteDocAndXattr (t * testing.T ) {
1414-
1415- SkipXattrTestsIfNotEnabled (t )
1416-
14171370 SetUpTestLogging (t , LevelDebug , KeyCRUD )
14181371
14191372 ctx := TestCtx (t )
@@ -1487,11 +1440,9 @@ func TestXattrDeleteDocAndXattr(t *testing.T) {
14871440// This simulates a race condition by calling deleteWithXattrInternal() and passing a custom
14881441// callback function
14891442func TestDeleteWithXattrWithSimulatedRaceResurrect (t * testing.T ) {
1490-
14911443 if UnitTestUrlIsWalrus () {
14921444 t .Skip ("Test requires CBS in order to use deleteWithXattrInternal callback" )
14931445 }
1494- SkipXattrTestsIfNotEnabled (t )
14951446
14961447 ctx := TestCtx (t )
14971448 bucket := GetTestBucket (t )
@@ -1533,9 +1484,6 @@ func TestDeleteWithXattrWithSimulatedRaceResurrect(t *testing.T) {
15331484
15341485// TestXattrRetrieveDocumentAndXattr.
15351486func TestXattrRetrieveDocumentAndXattr (t * testing.T ) {
1536-
1537- SkipXattrTestsIfNotEnabled (t )
1538-
15391487 ctx := TestCtx (t )
15401488 bucket := GetTestBucket (t )
15411489 defer bucket .Close (ctx )
@@ -1625,12 +1573,10 @@ func TestXattrRetrieveDocumentAndXattr(t *testing.T) {
16251573
16261574// TestXattrMutateDocAndXattr. Validates mutation of doc + xattr in various possible previous states of the document.
16271575func TestXattrMutateDocAndXattr (t * testing.T ) {
1628-
16291576 // Skipping on non-Couchbase until CBG-3392 is fixed
16301577 if UnitTestUrlIsWalrus () {
16311578 t .Skip ("Test requires Couchbase Server bucket when using xattrs" )
16321579 }
1633- SkipXattrTestsIfNotEnabled (t )
16341580
16351581 ctx := TestCtx (t )
16361582 bucket := GetTestBucket (t )
@@ -1750,8 +1696,6 @@ func TestXattrMutateDocAndXattr(t *testing.T) {
17501696}
17511697
17521698func TestGetXattr (t * testing.T ) {
1753- SkipXattrTestsIfNotEnabled (t )
1754-
17551699 ctx := TestCtx (t )
17561700 bucket := GetTestBucket (t )
17571701 defer bucket .Close (ctx )
@@ -1834,8 +1778,6 @@ func TestGetXattr(t *testing.T) {
18341778}
18351779
18361780func TestGetXattrAndBody (t * testing.T ) {
1837- SkipXattrTestsIfNotEnabled (t )
1838-
18391781 ctx := TestCtx (t )
18401782 bucket := GetTestBucket (t )
18411783 defer bucket .Close (ctx )
@@ -2244,7 +2186,6 @@ func verifyDocDeletedXattrExists(ctx context.Context, store sgbucket.XattrStore,
22442186}
22452187
22462188func TestUpdateXattrWithDeleteBodyAndIsDelete (t * testing.T ) {
2247- SkipXattrTestsIfNotEnabled (t )
22482189 SetUpTestLogging (t , LevelDebug , KeyCRUD )
22492190
22502191 ctx := TestCtx (t )
@@ -2290,7 +2231,6 @@ func TestUpdateXattrWithDeleteBodyAndIsDelete(t *testing.T) {
22902231}
22912232
22922233func TestUserXattrGetWithXattr (t * testing.T ) {
2293- SkipXattrTestsIfNotEnabled (t )
22942234 SetUpTestLogging (t , LevelDebug , KeyCRUD )
22952235
22962236 ctx := TestCtx (t )
@@ -2322,7 +2262,6 @@ func TestUserXattrGetWithXattr(t *testing.T) {
23222262}
23232263
23242264func TestUserXattrGetWithXattrNil (t * testing.T ) {
2325- SkipXattrTestsIfNotEnabled (t )
23262265 SetUpTestLogging (t , LevelDebug , KeyCRUD )
23272266
23282267 ctx := TestCtx (t )
@@ -2355,7 +2294,6 @@ func TestUserXattrGetWithXattrNil(t *testing.T) {
23552294}
23562295
23572296func TestInsertTombstoneWithXattr (t * testing.T ) {
2358- SkipXattrTestsIfNotEnabled (t )
23592297 SetUpTestLogging (t , LevelDebug , KeyCRUD )
23602298
23612299 ctx := TestCtx (t )
@@ -2709,7 +2647,6 @@ func requireXattrNotFoundError(t *testing.T, err error) {
27092647
27102648func TestWriteUpdateWithXattrsDocumentTombstone (t * testing.T ) {
27112649 ctx := TestCtx (t )
2712- SkipXattrTestsIfNotEnabled (t )
27132650
27142651 bucket := GetTestBucket (t )
27152652 defer bucket .Close (ctx )
@@ -3243,7 +3180,6 @@ func TestMetadataStoreUpdateAfterMigrationComplete(t *testing.T) {
32433180// Without the shortcut: callback would observe the actual primary body (because the wrapper
32443181// would pass nil for previous and primary.WriteUpdateWithXattrs would re-read).
32453182func TestMetadataStoreWriteUpdateWithXattrsCASShortcut (t * testing.T ) {
3246- SkipXattrTestsIfNotEnabled (t )
32473183 ctx := TestCtx (t )
32483184 bucket := GetTestBucket (t )
32493185 defer bucket .Close (ctx )
@@ -3309,7 +3245,6 @@ func TestMetadataStoreWriteUpdateWithXattrsCASShortcut(t *testing.T) {
33093245// returned in UpdatedDoc.Xattrs land in primary; xattrs the callback marked for deletion are
33103246// simply not migrated (which is equivalent to "deleted" since primary never held them).
33113247func TestMetadataStoreWriteUpdateWithXattrsHonorsXattrsToDelete (t * testing.T ) {
3312- SkipXattrTestsIfNotEnabled (t )
33133248 ctx := TestCtx (t )
33143249 bucket := GetTestBucket (t )
33153250 defer bucket .Close (ctx )
@@ -3364,7 +3299,6 @@ func TestMetadataStoreWriteUpdateWithXattrsHonorsXattrsToDelete(t *testing.T) {
33643299// that exists only in fallback, the wrapper writes the tombstone to fallback (the only store
33653300// that ever held the doc). Subsequent reads through the wrapper must surface not-found.
33663301func TestMetadataStoreWriteUpdateWithXattrsTombstoneFallbackOnly (t * testing.T ) {
3367- SkipXattrTestsIfNotEnabled (t )
33683302 ctx := TestCtx (t )
33693303 bucket := GetTestBucket (t )
33703304 defer bucket .Close (ctx )
@@ -3423,7 +3357,6 @@ func TestMetadataStoreWriteUpdateWithXattrsTombstoneFallbackOnly(t *testing.T) {
34233357// of TestMetadataStoreUpdateMigratesFromFallback: the wrapper must surface the fallback body and
34243358// xattrs to the callback and write the result to primary.
34253359func TestMetadataStoreWriteUpdateWithXattrsMigratesFromFallback (t * testing.T ) {
3426- SkipXattrTestsIfNotEnabled (t )
34273360 ctx := TestCtx (t )
34283361 bucket := GetTestBucket (t )
34293362 defer bucket .Close (ctx )
@@ -3584,7 +3517,6 @@ func TestMetadataStoreUpdateConcurrentFallbackWriterShadowed(t *testing.T) {
35843517// case the tombstone lives in fallback because the doc never made it to primary), and a
35853518// subsequent WriteUpdateWithXattrs must resurrect it — landing the live doc in primary.
35863519func TestMetadataStoreWriteUpdateWithXattrsResurrectsAfterFallbackTombstone (t * testing.T ) {
3587- SkipXattrTestsIfNotEnabled (t )
35883520 ctx := TestCtx (t )
35893521 bucket := GetTestBucket (t )
35903522 defer bucket .Close (ctx )
0 commit comments