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

Commit

Permalink
Switch to GCB and fix CI failures (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
punya committed Oct 28, 2021
1 parent 3ce4984 commit ed3a404
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 33 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/pull-request.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test-386:
.PHONY: test-with-coverage
test-with-coverage:
@echo pre-compiling tests
@time go test -i $(ALL_PKGS)
@go test -i $(ALL_PKGS)
$(GOTEST) $(GOTEST_OPT_WITH_COVERAGE) $(ALL_PKGS)
go tool cover -html=coverage.txt -o coverage.html

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

Expand Down
4 changes: 4 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
steps:
- name: golang:1.14
args: ["make", "install-tools", "ci"]
logsBucket: gs://opentelemetry-ops-e2e-cloud-build-logs
1 change: 1 addition & 0 deletions internal/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.
//

//go:build tools
// +build tools

package internal
Expand Down
17 changes: 9 additions & 8 deletions metrics_proto_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/golang/protobuf/ptypes/empty"
"google.golang.org/api/option"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/testing/protocmp"

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

ts := *tcFromFile.inMetric[0].Timeseries[0]
ts := proto.Clone(tcFromFile.inMetric[0].Timeseries[0]).(*metricspb.TimeSeries)
ts.LabelValues = []*metricspb.LabelValue{inEmptyValue, lv}
tcFromFile.inMetric[0].Timeseries = append(tcFromFile.inMetric[0].Timeseries, &ts)
tcFromFile.inMetric[0].Timeseries = append(tcFromFile.inMetric[0].Timeseries, ts)

j := i / 200
outTS := *(tcFromFile.outTSR[0].TimeSeries[0])
outTS := proto.Clone(tcFromFile.outTSR[0].TimeSeries[0]).(*monitoringpb.TimeSeries)
outTS.Metric = &googlemetricpb.Metric{
Type: tcFromFile.outMDR[0].MetricDescriptor.Type,
Labels: map[string]string{
Expand All @@ -305,7 +306,7 @@ func TestExportMaxTSPerRequest(t *testing.T) {
}
tcFromFile.outTSR = append(tcFromFile.outTSR, newOutTSR)
}
tcFromFile.outTSR[j].TimeSeries = append(tcFromFile.outTSR[j].TimeSeries, &outTS)
tcFromFile.outTSR[j].TimeSeries = append(tcFromFile.outTSR[j].TimeSeries, outTS)
}
executeTestCase(t, tcFromFile, se, server, nil)
}
Expand All @@ -326,10 +327,10 @@ func TestExportMaxTSPerRequestAcrossTwoMetrics(t *testing.T) {
for k := 0; k < 2; k++ {
for i := 1; i < 250; i++ {
v := fmt.Sprintf("value_%d", i+k*250)
ts := *tcFromFile.inMetric[k].Timeseries[0]
ts := proto.Clone(tcFromFile.inMetric[k].Timeseries[0]).(*metricspb.TimeSeries)
lv := &metricspb.LabelValue{Value: v, HasValue: true}
ts.LabelValues = []*metricspb.LabelValue{inEmptyValue, lv}
tcFromFile.inMetric[k].Timeseries = append(tcFromFile.inMetric[k].Timeseries, &ts)
tcFromFile.inMetric[k].Timeseries = append(tcFromFile.inMetric[k].Timeseries, ts)
}
}

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

// pick metric-1 for first 250 time-series and metric-2 for next 250 time-series.
mt := tcFromFile.outMDR[k].MetricDescriptor.Type
outTS := *(tcFromFile.outTSR[0].TimeSeries[0])
outTS := proto.Clone(tcFromFile.outTSR[0].TimeSeries[0]).(*monitoringpb.TimeSeries)
outTS.Metric = &googlemetricpb.Metric{
Type: mt,
Labels: map[string]string{
Expand All @@ -364,7 +365,7 @@ func TestExportMaxTSPerRequestAcrossTwoMetrics(t *testing.T) {
}
tcFromFile.outTSR = append(tcFromFile.outTSR, newOutTSR)
}
tcFromFile.outTSR[j].TimeSeries = append(tcFromFile.outTSR[j].TimeSeries, &outTS)
tcFromFile.outTSR[j].TimeSeries = append(tcFromFile.outTSR[j].TimeSeries, outTS)
}
}
executeTestCase(t, tcFromFile, se, server, nil)
Expand Down

0 comments on commit ed3a404

Please sign in to comment.