From 4fbe0652c994ce8a81e0cedc6c4b3d5e6d2c533f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 4 Sep 2023 13:22:26 +0100 Subject: [PATCH] compress: fix integration tests by adding missing OpenChunkWriter exclude --- backend/compress/compress_test.go | 66 +++++++++++++------------------ 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/backend/compress/compress_test.go b/backend/compress/compress_test.go index bb74f0aca..8fc954dfa 100644 --- a/backend/compress/compress_test.go +++ b/backend/compress/compress_test.go @@ -14,23 +14,26 @@ import ( "github.com/rclone/rclone/fstest/fstests" ) +var defaultOpt = fstests.Opt{ + RemoteName: "TestCompress:", + NilObject: (*Object)(nil), + UnimplementableFsMethods: []string{ + "OpenWriterAt", + "OpenChunkWriter", + "MergeDirs", + "DirCacheFlush", + "PutUnchecked", + "PutStream", + "UserInfo", + "Disconnect", + }, + TiersToTest: []string{"STANDARD", "STANDARD_IA"}, + UnimplementableObjectMethods: []string{}, +} + // TestIntegration runs integration tests against the remote func TestIntegration(t *testing.T) { - opt := fstests.Opt{ - RemoteName: *fstest.RemoteName, - NilObject: (*Object)(nil), - UnimplementableFsMethods: []string{ - "OpenWriterAt", - "MergeDirs", - "DirCacheFlush", - "PutUnchecked", - "PutStream", - "UserInfo", - "Disconnect", - }, - TiersToTest: []string{"STANDARD", "STANDARD_IA"}, - UnimplementableObjectMethods: []string{}} - fstests.Run(t, &opt) + fstests.Run(t, &defaultOpt) } // TestRemoteGzip tests GZIP compression @@ -40,28 +43,13 @@ func TestRemoteGzip(t *testing.T) { } tempdir := filepath.Join(os.TempDir(), "rclone-compress-test-gzip") name := "TestCompressGzip" - fstests.Run(t, &fstests.Opt{ - RemoteName: name + ":", - NilObject: (*Object)(nil), - UnimplementableFsMethods: []string{ - "OpenWriterAt", - "OpenChunkWriter", - "MergeDirs", - "DirCacheFlush", - "PutUnchecked", - "PutStream", - "UserInfo", - "Disconnect", - }, - UnimplementableObjectMethods: []string{ - "GetTier", - "SetTier", - }, - ExtraConfig: []fstests.ExtraConfigItem{ - {Name: name, Key: "type", Value: "compress"}, - {Name: name, Key: "remote", Value: tempdir}, - {Name: name, Key: "compression_mode", Value: "gzip"}, - }, - QuickTestOK: true, - }) + opt := defaultOpt + opt.RemoteName = name + ":" + opt.ExtraConfig = []fstests.ExtraConfigItem{ + {Name: name, Key: "type", Value: "compress"}, + {Name: name, Key: "remote", Value: tempdir}, + {Name: name, Key: "compression_mode", Value: "gzip"}, + } + opt.QuickTestOK = true + fstests.Run(t, &opt) }