compress: fix integration tests by adding missing OpenChunkWriter exclude

This commit is contained in:
Nick Craig-Wood 2023-09-04 13:22:26 +01:00
parent 47665dad07
commit 4fbe0652c9
1 changed files with 27 additions and 39 deletions

View File

@ -14,23 +14,26 @@ import (
"github.com/rclone/rclone/fstest/fstests" "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 // TestIntegration runs integration tests against the remote
func TestIntegration(t *testing.T) { func TestIntegration(t *testing.T) {
opt := fstests.Opt{ fstests.Run(t, &defaultOpt)
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)
} }
// TestRemoteGzip tests GZIP compression // TestRemoteGzip tests GZIP compression
@ -40,28 +43,13 @@ func TestRemoteGzip(t *testing.T) {
} }
tempdir := filepath.Join(os.TempDir(), "rclone-compress-test-gzip") tempdir := filepath.Join(os.TempDir(), "rclone-compress-test-gzip")
name := "TestCompressGzip" name := "TestCompressGzip"
fstests.Run(t, &fstests.Opt{ opt := defaultOpt
RemoteName: name + ":", opt.RemoteName = name + ":"
NilObject: (*Object)(nil), opt.ExtraConfig = []fstests.ExtraConfigItem{
UnimplementableFsMethods: []string{ {Name: name, Key: "type", Value: "compress"},
"OpenWriterAt", {Name: name, Key: "remote", Value: tempdir},
"OpenChunkWriter", {Name: name, Key: "compression_mode", Value: "gzip"},
"MergeDirs", }
"DirCacheFlush", opt.QuickTestOK = true
"PutUnchecked", fstests.Run(t, &opt)
"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,
})
} }