[pkg-go] autopkgtest

Michael Hudson-Doyle michael.hudson at canonical.com
Fri May 20 21:35:49 UTC 2016


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

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...

Cheers,
mwh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-go-maintainers/attachments/20160521/56639f0d/attachment.html>


More information about the Pkg-go-maintainers mailing list