build: implement a framework for starting test servers during tests

Test servers are implemented by docker containers and run real servers
for rclone to test against.
This commit is contained in:
Nick Craig-Wood
2019-10-04 16:51:07 +01:00
parent 00d30ce0d7
commit 24ef00a258
24 changed files with 687 additions and 7 deletions

View File

@@ -22,6 +22,7 @@ import (
"time"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fstest/testserver"
)
// Control concurrency per backend if required
@@ -213,6 +214,16 @@ func (r *Run) trial() {
return
}
// Start the test server if required
finish, err := testserver.Start(r.Remote)
if err != nil {
log.Printf("%s: Failed to start test server: %v", r.Remote, err)
_, _ = fmt.Fprintf(out, "%s: Failed to start test server: %v\n", r.Remote, err)
r.err = err
return
}
defer finish()
// Internal buffer
var b bytes.Buffer
multiOut := io.MultiWriter(out, &b)