Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit ed3a404

Browse files
authored
Switch to GCB and fix CI failures (#297)
1 parent 3ce4984 commit ed3a404

File tree

5 files changed

+16
-33
lines changed

5 files changed

+16
-33
lines changed

.github/workflows/pull-request.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test-386:
4343
.PHONY: test-with-coverage
4444
test-with-coverage:
4545
@echo pre-compiling tests
46-
@time go test -i $(ALL_PKGS)
46+
@go test -i $(ALL_PKGS)
4747
$(GOTEST) $(GOTEST_OPT_WITH_COVERAGE) $(ALL_PKGS)
4848
go tool cover -html=coverage.txt -o coverage.html
4949

@@ -52,7 +52,7 @@ test-with-cover:
5252
@echo Verifying that all packages have test files to count in coverage
5353
@scripts/check-test-files.sh $(subst contrib.go.opencensus.io/exporter/stackdriver,./,$(ALL_PKGS))
5454
@echo pre-compiling tests
55-
@time go test -i $(ALL_PKGS)
55+
@go test -i $(ALL_PKGS)
5656
$(GOTEST) $(GOTEST_OPT_WITH_COVERAGE) $(ALL_PKGS)
5757
go tool cover -html=coverage.txt -o coverage.html
5858

cloudbuild.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
steps:
2+
- name: golang:1.14
3+
args: ["make", "install-tools", "ci"]
4+
logsBucket: gs://opentelemetry-ops-e2e-cloud-build-logs

internal/tools.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// limitations under the License.
1414
//
1515

16+
//go:build tools
1617
// +build tools
1718

1819
package internal

metrics_proto_api_test.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/golang/protobuf/ptypes/empty"
2828
"google.golang.org/api/option"
2929
"google.golang.org/protobuf/encoding/prototext"
30+
"google.golang.org/protobuf/proto"
3031
"google.golang.org/protobuf/testing/protocmp"
3132

3233
googlemetricpb "google.golang.org/genproto/googleapis/api/metric"
@@ -286,12 +287,12 @@ func TestExportMaxTSPerRequest(t *testing.T) {
286287
v := fmt.Sprintf("value_%d", i)
287288
lv := &metricspb.LabelValue{Value: v, HasValue: true}
288289

289-
ts := *tcFromFile.inMetric[0].Timeseries[0]
290+
ts := proto.Clone(tcFromFile.inMetric[0].Timeseries[0]).(*metricspb.TimeSeries)
290291
ts.LabelValues = []*metricspb.LabelValue{inEmptyValue, lv}
291-
tcFromFile.inMetric[0].Timeseries = append(tcFromFile.inMetric[0].Timeseries, &ts)
292+
tcFromFile.inMetric[0].Timeseries = append(tcFromFile.inMetric[0].Timeseries, ts)
292293

293294
j := i / 200
294-
outTS := *(tcFromFile.outTSR[0].TimeSeries[0])
295+
outTS := proto.Clone(tcFromFile.outTSR[0].TimeSeries[0]).(*monitoringpb.TimeSeries)
295296
outTS.Metric = &googlemetricpb.Metric{
296297
Type: tcFromFile.outMDR[0].MetricDescriptor.Type,
297298
Labels: map[string]string{
@@ -305,7 +306,7 @@ func TestExportMaxTSPerRequest(t *testing.T) {
305306
}
306307
tcFromFile.outTSR = append(tcFromFile.outTSR, newOutTSR)
307308
}
308-
tcFromFile.outTSR[j].TimeSeries = append(tcFromFile.outTSR[j].TimeSeries, &outTS)
309+
tcFromFile.outTSR[j].TimeSeries = append(tcFromFile.outTSR[j].TimeSeries, outTS)
309310
}
310311
executeTestCase(t, tcFromFile, se, server, nil)
311312
}
@@ -326,10 +327,10 @@ func TestExportMaxTSPerRequestAcrossTwoMetrics(t *testing.T) {
326327
for k := 0; k < 2; k++ {
327328
for i := 1; i < 250; i++ {
328329
v := fmt.Sprintf("value_%d", i+k*250)
329-
ts := *tcFromFile.inMetric[k].Timeseries[0]
330+
ts := proto.Clone(tcFromFile.inMetric[k].Timeseries[0]).(*metricspb.TimeSeries)
330331
lv := &metricspb.LabelValue{Value: v, HasValue: true}
331332
ts.LabelValues = []*metricspb.LabelValue{inEmptyValue, lv}
332-
tcFromFile.inMetric[k].Timeseries = append(tcFromFile.inMetric[k].Timeseries, &ts)
333+
tcFromFile.inMetric[k].Timeseries = append(tcFromFile.inMetric[k].Timeseries, ts)
333334
}
334335
}
335336

@@ -350,7 +351,7 @@ func TestExportMaxTSPerRequestAcrossTwoMetrics(t *testing.T) {
350351

351352
// pick metric-1 for first 250 time-series and metric-2 for next 250 time-series.
352353
mt := tcFromFile.outMDR[k].MetricDescriptor.Type
353-
outTS := *(tcFromFile.outTSR[0].TimeSeries[0])
354+
outTS := proto.Clone(tcFromFile.outTSR[0].TimeSeries[0]).(*monitoringpb.TimeSeries)
354355
outTS.Metric = &googlemetricpb.Metric{
355356
Type: mt,
356357
Labels: map[string]string{
@@ -364,7 +365,7 @@ func TestExportMaxTSPerRequestAcrossTwoMetrics(t *testing.T) {
364365
}
365366
tcFromFile.outTSR = append(tcFromFile.outTSR, newOutTSR)
366367
}
367-
tcFromFile.outTSR[j].TimeSeries = append(tcFromFile.outTSR[j].TimeSeries, &outTS)
368+
tcFromFile.outTSR[j].TimeSeries = append(tcFromFile.outTSR[j].TimeSeries, outTS)
368369
}
369370
}
370371
executeTestCase(t, tcFromFile, se, server, nil)

0 commit comments

Comments
 (0)