Skip to content
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

Merged
merged 4 commits into from
Dec 27, 2019
Merged

Release 3.0.0-rc.4 #88

merged 4 commits into from
Dec 27, 2019

Conversation

bassosimone
Copy link
Member

No description provided.

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.
Copy link
Member Author

@bassosimone bassosimone left a 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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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" \
Copy link
Member Author

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 "$@"
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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"
Copy link
Member Author

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
Copy link
Member Author

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.

@bassosimone bassosimone merged commit 265177a into master Dec 27, 2019
@bassosimone bassosimone deleted the release/3.0.0-rc.4 branch December 27, 2019 10:30
ainghazal pushed a commit to ainghazal/probe-cli that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant