mirror of
https://github.com/octoleo/restic.git
synced 2024-11-30 00:33:57 +00:00
backup: log error if test backup fails
This commit is contained in:
parent
14370fbf9e
commit
51cd1c847b
@ -31,7 +31,7 @@ func testRunBackupAssumeFailure(t testing.TB, dir string, target []string, opts
|
|||||||
|
|
||||||
func testRunBackup(t testing.TB, dir string, target []string, opts BackupOptions, gopts GlobalOptions) {
|
func testRunBackup(t testing.TB, dir string, target []string, opts BackupOptions, gopts GlobalOptions) {
|
||||||
err := testRunBackupAssumeFailure(t, dir, target, opts, gopts)
|
err := testRunBackupAssumeFailure(t, dir, target, opts, gopts)
|
||||||
rtest.Assert(t, err == nil, "Error while backing up")
|
rtest.Assert(t, err == nil, "Error while backing up: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBackup(t *testing.T) {
|
func TestBackup(t *testing.T) {
|
||||||
@ -95,7 +95,7 @@ func testBackup(t *testing.T, useFsSnapshot bool) {
|
|||||||
func toPathInSnapshot(path string) string {
|
func toPathInSnapshot(path string) string {
|
||||||
// use path as is on most platforms, but convert it on windows
|
// use path as is on most platforms, but convert it on windows
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
// the path generate by the test is always local so take the shortcut
|
// the path generated by the test is always local so take the shortcut
|
||||||
vol := filepath.VolumeName(path)
|
vol := filepath.VolumeName(path)
|
||||||
if vol[len(vol)-1] != ':' {
|
if vol[len(vol)-1] != ':' {
|
||||||
panic(fmt.Sprintf("unexpected path: %q", path))
|
panic(fmt.Sprintf("unexpected path: %q", path))
|
||||||
|
Loading…
Reference in New Issue
Block a user