Open spenczar opened 7 years ago
Hmm, odd. (thanks for digging!)
Honestly, I haven't looked closely at the svn stuff (it's recently added, we didn't really support it before). All of the error handling there should follow a pretty standard pattern (that certainly does catch non-0 exit codes), so at first glance, it seems most likely that what we have just doesn't quite follow the pattern correctly.
There are a few things happening here.
I'm fairly certain that the reason that err
didn't return an error even though the command failed was because of a bug in runFromCwd
. I've fixed this in #204.
I don't know why you saw an SSL verification error, it works for me currently. You had to dig a bit to find this, because the errors returned from the vcs
package don't print the entire error message by default. It stores the error returned from running the command in the Original
variable, however this isn't printed in the tests. @sdboyer this might be a case where including the original error in unwrapVcsErr()
could be useful, but I'll have to investigate a bit more to be sure.
And finally, the reason for the nil pointer panic is that these tests don't stop when encountering errors, instead of calling t.Error
it should actually be calling t.Fatal
. I've created #205 to address this.
@jstemmer yeah, I'm convinced. I was also noting the actual errors not making it through the other night while working on #196. If you make a PR to fix unwrapVcsError()
, I'll merge it 😄
Sorry, it looks like I was mistaken. I've ran a few tests with invalid repo urls and the original error only contains the string exit status 1
. The actual error message is already captured from the command output and unwrapVcsErr
propagates that correctly. For this particular case it wouldn't add much value to include the original error. I'd be interested to know if it actually contained some useful information for the particular case you mentioned when working on #196.
Eh...it was late, and I was debugging a massively concurrent test, so I don't remember exactly :/ It may have been that I didn't have the fix from #204 yet at that point (I later adapted it into #196).
This issue was moved to golang/dep#416
TestSvnRepo
panics for me on the current master: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:Is it that the
svn
command exits with 0? No, it exits with 1:So it appears that the failure isn't getting correctly plumbed through.