From 4216d55a054710f6b5e31a47d52148e78e32652d Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 15 Nov 2021 16:25:35 +0000 Subject: [PATCH] test: make sure we run wrapping backend tests in "make quicktest" --- backend/chunker/chunker_test.go | 1 + backend/compress/compress_test.go | 4 ++++ backend/crypt/crypt_test.go | 6 ++++++ backend/hasher/hasher_test.go | 1 + backend/local/local_test.go | 5 +++-- backend/memory/memory_test.go | 5 +++-- backend/union/union_test.go | 6 ++++++ fstest/fstests/fstests.go | 3 ++- 8 files changed, 26 insertions(+), 5 deletions(-) diff --git a/backend/chunker/chunker_test.go b/backend/chunker/chunker_test.go index 4acdf5b5a..4b766ba7e 100644 --- a/backend/chunker/chunker_test.go +++ b/backend/chunker/chunker_test.go @@ -44,6 +44,7 @@ func TestIntegration(t *testing.T) { "UserInfo", "Disconnect", }, + QuickTestOK: true, } if *fstest.RemoteName == "" { name := "TestChunker" diff --git a/backend/compress/compress_test.go b/backend/compress/compress_test.go index 76baf22aa..66bbe9abb 100644 --- a/backend/compress/compress_test.go +++ b/backend/compress/compress_test.go @@ -16,6 +16,9 @@ import ( // TestIntegration runs integration tests against the remote func TestIntegration(t *testing.T) { + if *fstest.RemoteName == "" { + t.Skip("Skipping as -remote not set") + } opt := fstests.Opt{ RemoteName: *fstest.RemoteName, NilObject: (*Object)(nil), @@ -61,5 +64,6 @@ func TestRemoteGzip(t *testing.T) { {Name: name, Key: "remote", Value: tempdir}, {Name: name, Key: "compression_mode", Value: "gzip"}, }, + QuickTestOK: true, }) } diff --git a/backend/crypt/crypt_test.go b/backend/crypt/crypt_test.go index 8369a60f7..a8e0d6524 100644 --- a/backend/crypt/crypt_test.go +++ b/backend/crypt/crypt_test.go @@ -46,6 +46,7 @@ func TestStandardBase32(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -67,6 +68,7 @@ func TestStandardBase64(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -88,6 +90,7 @@ func TestStandardBase32768(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -109,6 +112,7 @@ func TestOff(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -131,6 +135,7 @@ func TestObfuscate(t *testing.T) { SkipBadWindowsCharacters: true, UnimplementableFsMethods: []string{"OpenWriterAt"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -154,5 +159,6 @@ func TestNoDataObfuscate(t *testing.T) { SkipBadWindowsCharacters: true, UnimplementableFsMethods: []string{"OpenWriterAt"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } diff --git a/backend/hasher/hasher_test.go b/backend/hasher/hasher_test.go index 09d60f33d..b341b5be7 100644 --- a/backend/hasher/hasher_test.go +++ b/backend/hasher/hasher_test.go @@ -25,6 +25,7 @@ func TestIntegration(t *testing.T) { "OpenWriterAt", }, UnimplementableObjectMethods: []string{}, + QuickTestOK: true, } if *fstest.RemoteName == "" { tempDir := filepath.Join(os.TempDir(), "rclone-hasher-test") diff --git a/backend/local/local_test.go b/backend/local/local_test.go index 8ecab2dbd..d0d54ec26 100644 --- a/backend/local/local_test.go +++ b/backend/local/local_test.go @@ -11,7 +11,8 @@ import ( // TestIntegration runs integration tests against the remote func TestIntegration(t *testing.T) { fstests.Run(t, &fstests.Opt{ - RemoteName: "", - NilObject: (*local.Object)(nil), + RemoteName: "", + NilObject: (*local.Object)(nil), + QuickTestOK: true, }) } diff --git a/backend/memory/memory_test.go b/backend/memory/memory_test.go index 3d768fec0..9989bc60d 100644 --- a/backend/memory/memory_test.go +++ b/backend/memory/memory_test.go @@ -10,7 +10,8 @@ import ( // TestIntegration runs integration tests against the remote func TestIntegration(t *testing.T) { fstests.Run(t, &fstests.Opt{ - RemoteName: ":memory:", - NilObject: (*Object)(nil), + RemoteName: ":memory:", + NilObject: (*Object)(nil), + QuickTestOK: true, }) } diff --git a/backend/union/union_test.go b/backend/union/union_test.go index c58936e9d..c612762f2 100644 --- a/backend/union/union_test.go +++ b/backend/union/union_test.go @@ -42,6 +42,7 @@ func TestStandard(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -64,6 +65,7 @@ func TestRO(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -86,6 +88,7 @@ func TestNC(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -108,6 +111,7 @@ func TestPolicy1(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -130,6 +134,7 @@ func TestPolicy2(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } @@ -152,5 +157,6 @@ func TestPolicy3(t *testing.T) { }, UnimplementableFsMethods: []string{"OpenWriterAt", "DuplicateFiles"}, UnimplementableObjectMethods: []string{"MimeType"}, + QuickTestOK: true, }) } diff --git a/fstest/fstests/fstests.go b/fstest/fstests/fstests.go index 3c9984926..d54bf58ea 100644 --- a/fstest/fstests/fstests.go +++ b/fstest/fstests/fstests.go @@ -295,6 +295,7 @@ type Opt struct { SkipFsCheckWrap bool // if set skip FsCheckWrap SkipObjectCheckWrap bool // if set skip ObjectCheckWrap SkipInvalidUTF8 bool // if set skip invalid UTF-8 checks + QuickTestOK bool // OK to run this test in "make quicktest" } // returns true if x is found in ss @@ -359,7 +360,7 @@ func Run(t *testing.T, opt *Opt) { unwrappableFsMethods = []string{"Command"} // these Fs methods don't need to be wrapped ever ) - if strings.HasSuffix(os.Getenv("RCLONE_CONFIG"), "/notfound") && *fstest.RemoteName == "" { + if !opt.QuickTestOK && strings.HasSuffix(os.Getenv("RCLONE_CONFIG"), "/notfound") && *fstest.RemoteName == "" { t.Skip("quicktest only") }