diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0ec8c072c..bb9945891 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -141,6 +141,14 @@ jobs: run: | go run build.go + - name: Minimal test + run: | + ./restic init + ./restic backup . + env: + RESTIC_REPOSITORY: ../testrepo + RESTIC_PASSWORD: password + - name: Run local Tests env: RESTIC_TEST_FUSE: ${{ matrix.test_fuse }} diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 487fa9673..31d5aac16 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -151,7 +151,9 @@ func init() { globalOptions.PasswordFile = os.Getenv("RESTIC_PASSWORD_FILE") globalOptions.KeyHint = os.Getenv("RESTIC_KEY_HINT") globalOptions.PasswordCommand = os.Getenv("RESTIC_PASSWORD_COMMAND") - globalOptions.RootCertFilenames = strings.Split(os.Getenv("RESTIC_CACERT"), ",") + if os.Getenv("RESTIC_CACERT") != "" { + globalOptions.RootCertFilenames = strings.Split(os.Getenv("RESTIC_CACERT"), ",") + } globalOptions.TLSClientCertKeyFilename = os.Getenv("RESTIC_TLS_CLIENT_CERT") comp := os.Getenv("RESTIC_COMPRESSION") if comp != "" { @@ -582,7 +584,7 @@ func open(ctx context.Context, s string, gopts GlobalOptions, opts options.Optio rt, err := backend.Transport(globalOptions.TransportOptions) if err != nil { - return nil, err + return nil, errors.Fatal(err.Error()) } // wrap the transport so that the throughput via HTTP is limited @@ -638,7 +640,7 @@ func create(ctx context.Context, s string, gopts GlobalOptions, opts options.Opt rt, err := backend.Transport(globalOptions.TransportOptions) if err != nil { - return nil, err + return nil, errors.Fatal(err.Error()) } factory := gopts.backends.Lookup(loc.Scheme)