Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Errors in svn checkout do not propagate correctly #416

@fabulous-gopher

Description

@fabulous-gopher

From @spenczar on March 20, 2017 22:41

TestSvnRepo panics for me on the current master:

-> % go test -v -run TestSvnRepo .
=== RUN   TestSvnRepo
--- FAIL: TestSvnRepo (0.05s)
	vcs_repo_test.go:45: Problem checking out repo or SVN CheckLocal is not working
	vcs_repo_test.go:51: Unable to update SVN repo version. Err was unable to update checked out version
	vcs_repo_test.go:57: Error checking checked SVN out version
	vcs_repo_test.go:60: Unable to retrieve checked out version
	vcs_repo_test.go:66: unable to update repository
	vcs_repo_test.go:75: Unable to retrieve checked out version
	vcs_repo_test.go:80: unable to retrieve commit information
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x13d9ed7]

goroutine 21 [running]:
testing.tRunner.func1(0xc42026a340)
	/Users/snelson/go1.8/src/testing/testing.go:622 +0x29d
panic(0x14b91e0, 0x1a93810)
	/Users/snelson/go1.8/src/runtime/panic.go:489 +0x2cf
github.com/sdboyer/gps.TestSvnRepo(0xc42026a340)
	/Users/snelson/go/src/github.com/sdboyer/gps/vcs_repo_test.go:82 +0x727
testing.tRunner(0xc42026a340, 0x1551ce0)
	/Users/snelson/go1.8/src/testing/testing.go:657 +0x96
created by testing.(*T).Run
	/Users/snelson/go1.8/src/testing/testing.go:697 +0x2ca
exit status 2
FAIL	github.com/sdboyer/gps	2.695s

This panic is happening because even though the err = repo.Get() line at L45 doesn't return an error, it is, in fact, failing. I hacked into the internals to print the command output, and I saw this:

2017/03/20 18:34:20 running command &{%!s(*exec.Cmd=&{/usr/bin/svn [svn checkout https://github.com/Masterminds/VCSTestRepo/trunk /var/folders/07/3tqty4fn0pqdmk8kyscf2g2m0wg_zb/T/go-vcs-svn-tests045048261/VCSTestRepo] []  <nil> 0xc420249800 0xc420249830 [] <nil> <nil> <nil> <nil> <nil> false [] [] [] [] <nil> <nil>}) %!s(time.Duration=120000000000) %!s(*gps.activityBuffer=&{{0 0} 0xc4201a7810 {0 0 <nil>}}) %!s(*gps.activityBuffer=&{{0 0} 0xc4201a7880 {0 0 <nil>}})}
2017/03/20 18:34:20 out=svn: E170013: Unable to connect to a repository at URL 'https://github.com/Masterminds/VCSTestRepo/trunk'
svn: E230001: Server SSL certificate verification failed: issuer is not trusted

Is it that the svn command exits with 0? No, it exits with 1:

-> % svn checkout "https://github.com/Masterminds/VCSTestRepo/trunk" . --non-interactive
svn: E170013: Unable to connect to a repository at URL 'https://github.com/Masterminds/VCSTestRepo/trunk'
svn: E230001: Server SSL certificate verification failed: issuer is not trusted

-> % echo $?
1

So it appears that the failure isn't getting correctly plumbed through.

Copied from original issue: sdboyer/gps#200

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions