<p dir="ltr"><br>
On 21/05/2016 7:33 am, "Martín Ferrari" <<a href="mailto:tincho@tincho.org">tincho@tincho.org</a>> wrote:<br>
><br>
> On 20/05/16 05:24, Michael Hudson-Doyle wrote:<br>
> > Somehow I don't have Martín's original mail...<br>
><br>
> Here it is:<br>
> <a href="https://www.mail-archive.com/pkg-go-maintainers@lists.alioth.debian.org/msg03657.html">https://www.mail-archive.com/pkg-go-maintainers@lists.alioth.debian.org/msg03657.html</a><br>
><br>
> On 20/05/16 05:51, Michael Hudson-Doyle wrote:<br>
><br>
> >> GOPATH=/usr/share/gocode go test -short $(perl<br>
> >> -MDebian::Debhelper::Dh_Buildsystems -e 'buildsystems_init(); my $bs =<br>
> >> load_buildsystem("golang"); print(join " ", $bs->get_targets(),<br>
> >> "\n");')<br>
> ><br>
> > Oh, this doesn't quite work does it, because you want the influence of<br>
> > the other variables that might be set in rules, like<br>
> > DH_GOLANG_BUILDPKG & DH_GOLANG_EXCLUDES. Maybe just re-running the<br>
> > package build in the autopkgest environment would be best, or at least<br>
> > ./debian/rules build. It wouldn't even be very inefficient, because<br>
> > the package has to be recompiled to be tested anyway.<br>
><br>
> Actually, the idea is to test the *installed* package. So IMO the best<br>
> is to just get the import-path and run go test with the GOPATH set as<br>
> you suggest.<br>
><br>
> I tried this locally and works perfectly.</p>
<p dir="ltr">It won't work for debian packages that have go packages that fail tests (or fail to build!) in DH_GOLANG_EXCLUDES. You could argue that such packages are broken, but there are definitely a few in the archive. Perhaps we should just patch those tests out (// +build ignore, I guess) instead...</p>
<p dir="ltr">Cheers,<br>
mwh</p>