Commit Graph

7 Commits

Author SHA1 Message Date
Joe Tsai
9d19e5c432 test.bash: update to protoc3.7.1 and go1.11.6 and go1.12.1
Change-Id: I787ffa48dc075c74fe51737dfc98f23371c0b189
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/170628
Reviewed-by: Herbie Ong <herbie@google.com>
2019-04-04 01:07:53 +00:00
Herbie Ong
4630b3daa6 integration_test: fix race condition between stderr and stdout
Split output of stderr and stdout instead of using combined buffer.

Change-Id: I4099ebca15099e91539b3ebab6b410fc49f76ce1
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/168347
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2019-03-19 23:48:10 +00:00
Joe Tsai
9e88bc0b67 test.bash: purge unused directories based on timeout
Rather than manually keeping track of which directories may be used
by other branches, use a time-based approach to determine whether
to purge a sub-directory or not.

Change-Id: I648dcca075e351e4e5624c48e73792782fc349ca
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/167042
Reviewed-by: Herbie Ong <herbie@google.com>
2019-03-12 17:29:50 +00:00
Joe Tsai
bb786ea59e test.bash: update to protobuf 3.7.0
Change-Id: Id1237eaf92d6a07c57b279a59fb6bd794af0f231
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/167041
Reviewed-by: Herbie Ong <herbie@google.com>
2019-03-12 08:34:56 +00:00
Joe Tsai
d56458e71b internal/cmd/generate-protos: generate test for testdata
Running "go build ./..." does not descend into testdata directories.
However, the testdata in this repository is source code that is
intended to build properly. We could rename the directory, but that does
not test whether the generated packages can initialize properly.

Thus, we generate a trivial test that simply blank imports all packages.

Doing this reveals that some of the generated files have incorrect imports,
leading to registration conflicts.

To avoid introducing a dependency on gRPC from our go.mod file, we put
the testdata directories in their own module. Also, we avoid running
internal/testprotos through the grpc plugin because the servie and method
definitions in that directory are more for testing proto file initialization
rather than testing grpc generation.

Change-Id: Iaa6a06449787a085200e31bc7606e3ac904d3180
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/164917
Reviewed-by: Damien Neil <dneil@google.com>
2019-03-11 19:40:53 +00:00
Joe Tsai
f398784f99 .travis.yml: fix travis CI
Changes made:
* Call autogen.sh before building protobuf.
It's unclear how this worked before, but the README instructions for
protobuf does state to run autogen.sh prior to building and installing.
* Fix downloadArchive to take in a prefix path rather than the number of
prefix directories to skip. The reason for this change is due to a bug
in the Go build system where unexpected directories were being packed.
See https://golang.org/issue/29906
* Explicitly set Travis dist to be "xenial", which comes with Go1.11.
We require Go1.11 for two reasons:
	* The use of t.Helper in integration_test.go
	* Proper understanding of the -mod=vendor flag
	(even if all that flag does is disable modules).
* Add a hack to integration_test.go to periodically output the timestamp
to work around a restriction in Travis where it auto-kills the test
after 10 minutes of no stdout activity.

Change-Id: I114fe2855faeed091c34d79df3d97068be7eccd8
Reviewed-on: https://go-review.googlesource.com/c/164919
Reviewed-by: Herbie Ong <herbie@google.com>
2019-03-03 00:55:36 +00:00
Joe Tsai
707894e869 test.bash: rewrite the integration test in Go
This CL switches the integration test to be written in Go instead of bash.
The benefits are:
* The logic for setting up the dependencies is more robust and
handles better a situation where the dependency failed to initialize
(due to network trouble, FS permission problems, etc).
* The logic does a better job at cleaning up stale dependencies.
For example, my .cache folder has go1.9.4, go1.9.5, go1.10.5, and go1.10.6
folders even though we don't use them anymore.
* Being able to run only a subset of the integration test since you can
pass "-run" to the script.
* A signifcant amount of complexity in the test.bash script was running
the tests in parallel. This is trivial to do in Go.

The major detriment is that Go is more verbose as a "scripting" language.

Change-Id: Id7e5b303fb305fdbc0368bdf809dbf29fca1d983
Reviewed-on: https://go-review.googlesource.com/c/164861
Reviewed-by: Herbie Ong <herbie@google.com>
2019-03-02 00:04:20 +00:00