From 5fef6a84a86078f3e4ca0fe2842c2ed1cb93cd80 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 31 Aug 2026 12:36:28 +0100 Subject: [PATCH] opendrive: run the chunked upload integration tests Implement SetUploadChunkSizer in the tests so fstests can exercise the chunked upload path with small chunk sizes. --- backend/opendrive/opendrive_internal_test.go | 17 +++++++++++++++++ backend/opendrive/opendrive_test.go | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 backend/opendrive/opendrive_internal_test.go diff --git a/backend/opendrive/opendrive_internal_test.go b/backend/opendrive/opendrive_internal_test.go new file mode 100644 index 000000000..55c936b35 --- /dev/null +++ b/backend/opendrive/opendrive_internal_test.go @@ -0,0 +1,17 @@ +package opendrive + +import ( + "github.com/rclone/rclone/fs" + "github.com/rclone/rclone/fstest/fstests" +) + +// SetUploadChunkSize changes the configured chunk size, returning the old value. +// +// It is only called by the integration tests while no transfer is in progress. +func (f *Fs) SetUploadChunkSize(cs fs.SizeSuffix) (fs.SizeSuffix, error) { + var old fs.SizeSuffix + old, f.opt.ChunkSize = f.opt.ChunkSize, cs + return old, nil +} + +var _ fstests.SetUploadChunkSizer = (*Fs)(nil) diff --git a/backend/opendrive/opendrive_test.go b/backend/opendrive/opendrive_test.go index f857ed478..a3fd8e968 100644 --- a/backend/opendrive/opendrive_test.go +++ b/backend/opendrive/opendrive_test.go @@ -13,5 +13,8 @@ func TestIntegration(t *testing.T) { fstests.Run(t, &fstests.Opt{ RemoteName: "TestOpenDrive:", NilObject: (*opendrive.Object)(nil), + ChunkedUpload: fstests.ChunkedUploadConfig{ + MinChunkSize: 1, + }, }) }