From ea97ff1ba4e5d1386b88d6cbda32f48c7fbc8a63 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 26 Jul 2020 12:06:18 +0200 Subject: [PATCH] rclone: Skip crash test when rclone is not found --- internal/backend/rclone/internal_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/backend/rclone/internal_test.go b/internal/backend/rclone/internal_test.go index 1705d9baf..435428870 100644 --- a/internal/backend/rclone/internal_test.go +++ b/internal/backend/rclone/internal_test.go @@ -2,8 +2,10 @@ package rclone import ( "context" + "os/exec" "testing" + "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" ) @@ -16,6 +18,10 @@ func TestRcloneExit(t *testing.T) { cfg := NewConfig() cfg.Remote = dir be, err := Open(cfg, nil) + if e, ok := errors.Cause(err).(*exec.Error); ok && e.Err == exec.ErrNotFound { + t.Skipf("program %q not found", e.Name) + return + } rtest.OK(t, err) defer be.Close()