Skip to content

Commit

Permalink
Use go modules to fix upstream dependency breakage. (#93)
Browse files Browse the repository at this point in the history
* fix googleapis imports

* add go module

* use go1.13

* disable vetting other projects

* keep stats.Location with comment

* tweak required version numbers

* go mod tidy
  • Loading branch information
gfr10598 authored Jan 13, 2020
1 parent 819f6c4 commit c02fefa
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 16 deletions.
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#
language: go
go:
- "1.12"
- "1.13"

dist: xenial

Expand Down Expand Up @@ -51,14 +51,15 @@ script:
- go test -covermode=count -coverprofile=_bqext.cov -v ./bqext -tags=$TEST_TAGS

# Check we haven't broken any dependent projects
- go get -t github.com/m-lab/etl/...
- go vet github.com/m-lab/etl/...
- go get -t github.com/m-lab/etl-gardener/...
- go vet github.com/m-lab/etl-gardener/...
# Many things are currently broken, so temporarily removing the vets.
# - go get -t github.com/m-lab/etl/...
# - go vet github.com/m-lab/etl/...
# - go get -t github.com/m-lab/etl-gardener/...
# - go vet github.com/m-lab/etl-gardener/...
- go get -t github.com/m-lab/uuid/...
- go vet github.com/m-lab/uuid/...
- go get -t github.com/m-lab/pusher/...
- go vet github.com/m-lab/pusher/...
# - go get -t github.com/m-lab/pusher/...
# - go vet github.com/m-lab/pusher/...

# We should also check these, but they currently fail due to C issues.
# - go get -t github.com/m-lab/ndt-server/...
Expand Down
5 changes: 4 additions & 1 deletion bqext/dataset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ func TestGetTableStatsMock(t *testing.T) {
json.Unmarshal([]byte(wantTableMetadata), &want)

stats.ETag = "" // Ignore this field for comparison.
stats.Location = ""
// Location was introduced after bigquery v1.3.0, and may result in flaky tests
// if included in the next release.
// stats.Location = ""

if diff := deep.Equal(*stats, want); diff != nil {
t.Error(diff)
}
Expand Down
2 changes: 1 addition & 1 deletion cloud/bqfake/bqfake.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"log"

"cloud.google.com/go/bigquery"
"github.com/GoogleCloudPlatform/google-cloud-go-testing/bigquery/bqiface"
"github.com/googleapis/google-cloud-go-testing/bigquery/bqiface"
"google.golang.org/api/iterator"
)

Expand Down
2 changes: 1 addition & 1 deletion cloud/bqfake/bqfake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"google.golang.org/api/option"

"cloud.google.com/go/bigquery"
"github.com/GoogleCloudPlatform/google-cloud-go-testing/bigquery/bqiface"
"github.com/googleapis/google-cloud-go-testing/bigquery/bqiface"
"github.com/m-lab/go/cloud/bqfake"
"google.golang.org/api/iterator"
)
Expand Down
2 changes: 1 addition & 1 deletion cloud/bqfake/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync/atomic"

"cloud.google.com/go/bigquery"
"github.com/GoogleCloudPlatform/google-cloud-go-testing/bigquery/bqiface"
"github.com/googleapis/google-cloud-go-testing/bigquery/bqiface"
"google.golang.org/api/option"
)

Expand Down
2 changes: 1 addition & 1 deletion cloudtest/dsfake/dsfake.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"sync"

"cloud.google.com/go/datastore"
"github.com/GoogleCloudPlatform/google-cloud-go-testing/datastore/dsiface"
"github.com/googleapis/google-cloud-go-testing/datastore/dsiface"
)

// NOTE: This is over-restrictive, but fine for current purposes.
Expand Down
2 changes: 1 addition & 1 deletion cloudtest/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"

"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/google-cloud-go-testing/storage/stiface"
"github.com/googleapis/google-cloud-go-testing/storage/stiface"
"google.golang.org/api/iterator"
)

Expand Down
2 changes: 1 addition & 1 deletion cloudtest/gcs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"time"

"cloud.google.com/go/storage"
"github.com/GoogleCloudPlatform/google-cloud-go-testing/storage/stiface"
"github.com/googleapis/google-cloud-go-testing/storage/stiface"
"github.com/m-lab/go/cloudtest"
"google.golang.org/api/iterator"
)
Expand Down
2 changes: 1 addition & 1 deletion dataset/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"time"

"cloud.google.com/go/bigquery"
"github.com/GoogleCloudPlatform/google-cloud-go-testing/bigquery/bqiface"
"github.com/googleapis/google-cloud-go-testing/bigquery/bqiface"
"golang.org/x/net/context"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
Expand Down
4 changes: 3 additions & 1 deletion dataset/dataset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ func TestGetTableStatsMock(t *testing.T) {
json.Unmarshal([]byte(wantTableMetadata), &want)

stats.ETag = "" // Ignore this field for comparison.
stats.Location = ""
// Location was introduced after bigquery v1.3.0, and may result in flaky tests
// if included in the next release.
// stats.Location = ""
if diff := deep.Equal(*stats, want); diff != nil {
t.Error(diff)
}
Expand Down
20 changes: 20 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module github.com/m-lab/go

go 1.13

require (
cloud.google.com/go/bigquery v1.3.0
cloud.google.com/go/datastore v1.0.0
cloud.google.com/go/storage v1.5.0
github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195
github.com/go-test/deep v1.0.4
github.com/googleapis/google-cloud-go-testing v0.0.0-20191008195207-8e1d251e947d
github.com/kabukky/httpscerts v0.0.0-20150320125433-617593d7dcb3
github.com/kr/pretty v0.2.0
github.com/prometheus/client_golang v1.3.0
github.com/prometheus/prometheus v2.5.0+incompatible
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6
google.golang.org/api v0.15.0
gopkg.in/yaml.v2 v2.2.7
)
293 changes: 293 additions & 0 deletions go.sum

Large diffs are not rendered by default.

0 comments on commit c02fefa

Please sign in to comment.