From cc0421cb9e8750d9491c9b1006e6d5d06d6d0c97 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 31 Aug 2020 12:38:46 +0100 Subject: [PATCH] rc/webgui: skip AddPlugin and RemovePlugin tests if download fails --- fs/rc/webgui/rc_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/rc/webgui/rc_test.go b/fs/rc/webgui/rc_test.go index 7b7cb9826..82b19ec10 100644 --- a/fs/rc/webgui/rc_test.go +++ b/fs/rc/webgui/rc_test.go @@ -5,10 +5,12 @@ import ( "io/ioutil" "os" "path/filepath" + "strings" "testing" "github.com/rclone/rclone/fs/rc" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) const testPluginName = "rclone-test-plugin" @@ -39,7 +41,10 @@ func addPlugin(t *testing.T) { "url": testPluginURL, } out, err := addPlugin.Fn(context.Background(), in) - assert.Nil(t, err) + if err != nil && strings.Contains(err.Error(), "bad HTTP status") { + t.Skipf("skipping test as plugin download failed: %v", err) + } + require.Nil(t, err) assert.Nil(t, out) }