-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 3.0.0-rc.4 #88
Conversation
1. `go get -u github.com/ooni/probe-engine@v0.3.0` 2. `go mod tidy` 3. fix build failures
Factor code and reorganize location of go cache and go paths such that subsequent invocations reuse both dirs.
305820a
to
6cccfeb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have documented all the changes in this PR.
@@ -1 +1,2 @@ | |||
/dist | |||
/testdata/gotmp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For documentation purposes: this stores in the current directory the GOPATH and the GOCACHE. This way go
can reuse the same files in subsequent invocations via Docker. Of course, this makes Docker invocations faster.
@@ -3,12 +3,6 @@ dist: xenial | |||
language: minimal | |||
services: | |||
- docker | |||
env: | |||
- OS_NAME: linux |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable was unnecessary as we can use TRAVIS_OS_NAME
set by Travis.
- OS_NAME: linux | ||
before_script: | ||
- go get golang.org/x/tools/cmd/cover | ||
- go get github.com/mattn/goveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're running these commands inside Docker. We want to use the same version of Go for all the operations that pertain to Go code. We have seen build failures otherwise, because goveralls
seems to import Go code.
See for example https://travis-ci.org/ooni/probe-cli/builds/629707378#L1213
@@ -1,3 +1,2 @@ | |||
FROM openobservatory/mk-alpine:latest | |||
RUN apk add --no-progress git go | |||
ADD . /oonibuild |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was redundant
--user `id -u`:`id -g` -e 'GOCACHE=/tmp/go/cache' -e 'GOPATH=/tmp/go/path' \ | ||
oonibuild \ | ||
go build $buildtags -ldflags="$ldflags" \ | ||
$0 __docker go build $buildtags -ldflags="$ldflags" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code to build docker container and to run the container has been factored into a sub command.
-e 'GOPATH=/oonibuild/testdata/gotmp/path' \ | ||
-e "TRAVIS_JOB_ID=$TRAVIS_JOB_ID" \ | ||
-e "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST" \ | ||
oonibuild "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new __docker
sub command. Note that we pass along the environment variables that goveralls
will use to submit the coverage information to Coveralls.
$0 __docker go get -v github.com/mattn/goveralls | ||
$0 __docker go test -v -coverprofile=coverage.cov -coverpkg=./... ./... | ||
$0 __docker /oonibuild/testdata/gotmp/path/bin/goveralls \ | ||
-coverprofile=coverage.cov -service=travis-ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we basically run all the running-tests workflow inside docker. It's rather quick because rebuilding the same container is idempotent and because we're storing the GOCACHE in a local directory.
@@ -5,23 +5,19 @@ go 1.12 | |||
require ( | |||
github.com/alecthomas/kingpin v2.2.6+incompatible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file contains updates to the direct dependencies
@@ -3,30 +3,30 @@ package nettests | |||
import ( | |||
"github.com/apex/log" | |||
"github.com/ooni/probe-cli/internal/database" | |||
engine "github.com/ooni/probe-engine" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Between v0.2.0 and v0.3.0 the ooni/probe-engine API changed. This adapts the code to the new API.
./dist/${OS_NAME}/amd64/ooniprobe onboard --yes | ||
./dist/${OS_NAME}/amd64/ooniprobe run --config testdata/testing-config.json -v --no-collector | ||
./dist/${TRAVIS_OS_NAME}/amd64/ooniprobe onboard --yes | ||
./dist/${TRAVIS_OS_NAME}/amd64/ooniprobe run --config testdata/testing-config.json -v --no-collector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we're using a variable already set for us by Travis.
Release 3.0.0-rc.4
No description provided.