Go on GAE: goapp get annoyances

258 views
Skip to first unread message

orhi...@gmail.com

unread,
Sep 27, 2014, 5:27:01 AM9/27/14
to golan...@googlegroups.com
Hi,

I have several go projects which run on GAE. I wish to establish CI (or at least testing upon push to GitHub) with Travis for some these projects.

To begin with, I am trying to get Travis to execute my apps tests. To achieve this, my .travis file looks like this:
language: go
go:
  - "1.2.1"

install:
  - curl -O https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.12.zip && unzip -q go_appengine_sdk_linux_amd64-1.9.12.zip

before_script: ./go_appengine/goapp get
script: ./go_appengine/goapp test

Problem is: the goapp get command returns status code 1 (which indicates error and thus will stop the build) because some GAE packages do not contain a "buildable go source". For example, anything that imports package "code.google.com/p/google-api-go-client/bigquery/v2" will get this error when you run:

goapp get

you get this message:

imports code.google.com/p/goauth2/appengine/serviceaccount: no buildable Go source files in /users/orcaman/src/code.google.com/p/goauth2/appengine/serviceaccount

Yet after performing the goapp get, everything basically works albeit the error (I guess this is because the goapp executable knows how to treat these GAE packages). so running: 

goapp test

for a testing code that uses code.google.com/p/goauth2/appengine/serviceaccount locally works perfectly. 

Any ideas on how to work around this to be be able to use Travis with GAE's Go?

Cheers,
Or


David Symonds

unread,
Sep 27, 2014, 5:08:21 PM9/27/14
to orhi...@gmail.com, golang-nuts

Have you tried using `goapp get -d <blah>`?

orhi...@gmail.com

unread,
Sep 28, 2014, 1:30:12 AM9/28/14
to golan...@googlegroups.com, orhi...@gmail.com
Thanks for the tip David.

Unforunately adding the -d flag did not solve the issue:


16.97s
$ ./go_appengine/goapp get -d

package code.google.com/p/goauth2/appengine/serviceaccount

imports code.google.com/p/goauth2/appengine/serviceaccount

imports code.google.com/p/goauth2/appengine/serviceaccount: no buildable Go source files in /home/travis/gopath/src/code.google.com/p/goauth2/appengine/serviceaccount

The command "./go_appengine/goapp get -d" failed and exited with 1 during .


I ended up writing the goapp get command as a shell script that always returns 0 for now. So in my .tavis file I have:
before_script: ./script/ci/get_deps.sh
and in the get_deps.sh I've got:

#!/bin/sh
echo "running goapp get to fetch dependencies..."
./go_appengine/goapp get
echo "dependencies fetched."
exit 0

This works as a workaround (because even though the script always returns 0, if the dep failed to be fetched, then the compilation would fail in the next step, so not a very silent failure) but obviously not ideal.
Reply all
Reply to author
Forward
0 new messages