f0647f33f5
un-pinning the dependency full diff: https://github.com/census-instrumentation/opencensus-go/compare/v0.22.3...v0.23.0 - replace gofmt with goimports - Allow creating additional View universes - Safely reject invalid-length span and trace ids - fix Panic when x-b3-spanid exceeds 16 characters - Reduce allocations - Remove call to time.Now() on worker thread when handling record reqs - Delete views from measure ref when unregistering - Allow custom view.Meters to export metrics for other Resources - Initialize View Start Time During View Registration - Record a Start Time Per Time Series within a View - Made public traceparent/tracestate marshal/unmarshal - Fix const labels with derived metrics - Defer IDGenerator initialization until first use - Allow replacing trace SDK - Provide accessor to the span implementation - Lock only when needed, remove duplicate code - Update dependencies - fix memory leak cause by the spanStore.(census-instrumentation/opencensus-go) - Adds an exported function to flush interval reader - Adding GC stats to runmetrics plugin Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
97 lines
2.6 KiB
Makefile
97 lines
2.6 KiB
Makefile
# TODO: Fix this on windows.
|
|
ALL_SRC := $(shell find . -name '*.go' \
|
|
-not -path './vendor/*' \
|
|
-not -path '*/gen-go/*' \
|
|
-type f | sort)
|
|
ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC))))
|
|
|
|
GOTEST_OPT?=-v -race -timeout 30s
|
|
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic
|
|
GOTEST=go test
|
|
GOIMPORTS=goimports
|
|
GOLINT=golint
|
|
GOVET=go vet
|
|
EMBEDMD=embedmd
|
|
# TODO decide if we need to change these names.
|
|
TRACE_ID_LINT_EXCEPTION="type name will be used as trace.TraceID by other packages"
|
|
TRACE_OPTION_LINT_EXCEPTION="type name will be used as trace.TraceOptions by other packages"
|
|
README_FILES := $(shell find . -name '*README.md' | sort | tr '\n' ' ')
|
|
|
|
.DEFAULT_GOAL := imports-lint-vet-embedmd-test
|
|
|
|
.PHONY: imports-lint-vet-embedmd-test
|
|
imports-lint-vet-embedmd-test: imports lint vet embedmd test
|
|
|
|
# TODO enable test-with-coverage in tavis
|
|
.PHONY: travis-ci
|
|
travis-ci: imports lint vet embedmd test test-386
|
|
|
|
all-pkgs:
|
|
@echo $(ALL_PKGS) | tr ' ' '\n' | sort
|
|
|
|
all-srcs:
|
|
@echo $(ALL_SRC) | tr ' ' '\n' | sort
|
|
|
|
.PHONY: test
|
|
test:
|
|
$(GOTEST) $(GOTEST_OPT) $(ALL_PKGS)
|
|
|
|
.PHONY: test-386
|
|
test-386:
|
|
GOARCH=386 $(GOTEST) -v -timeout 30s $(ALL_PKGS)
|
|
|
|
.PHONY: test-with-coverage
|
|
test-with-coverage:
|
|
$(GOTEST) $(GOTEST_OPT_WITH_COVERAGE) $(ALL_PKGS)
|
|
|
|
.PHONY: imports
|
|
imports:
|
|
@IMPORTSOUT=`$(GOIMPORTS) -l $(ALL_SRC) 2>&1`; \
|
|
if [ "$$IMPORTSOUT" ]; then \
|
|
echo "$(GOIMPORTS) FAILED => goimports the following files:\n"; \
|
|
echo "$$IMPORTSOUT\n"; \
|
|
exit 1; \
|
|
else \
|
|
echo "Imports finished successfully"; \
|
|
fi
|
|
|
|
.PHONY: lint
|
|
lint:
|
|
@LINTOUT=`$(GOLINT) $(ALL_PKGS) | grep -v $(TRACE_ID_LINT_EXCEPTION) | grep -v $(TRACE_OPTION_LINT_EXCEPTION) 2>&1`; \
|
|
if [ "$$LINTOUT" ]; then \
|
|
echo "$(GOLINT) FAILED => clean the following lint errors:\n"; \
|
|
echo "$$LINTOUT\n"; \
|
|
exit 1; \
|
|
else \
|
|
echo "Lint finished successfully"; \
|
|
fi
|
|
|
|
.PHONY: vet
|
|
vet:
|
|
# TODO: Understand why go vet downloads "github.com/google/go-cmp v0.2.0"
|
|
@VETOUT=`$(GOVET) ./... | grep -v "go: downloading" 2>&1`; \
|
|
if [ "$$VETOUT" ]; then \
|
|
echo "$(GOVET) FAILED => go vet the following files:\n"; \
|
|
echo "$$VETOUT\n"; \
|
|
exit 1; \
|
|
else \
|
|
echo "Vet finished successfully"; \
|
|
fi
|
|
|
|
.PHONY: embedmd
|
|
embedmd:
|
|
@EMBEDMDOUT=`$(EMBEDMD) -d $(README_FILES) 2>&1`; \
|
|
if [ "$$EMBEDMDOUT" ]; then \
|
|
echo "$(EMBEDMD) FAILED => embedmd the following files:\n"; \
|
|
echo "$$EMBEDMDOUT\n"; \
|
|
exit 1; \
|
|
else \
|
|
echo "Embedmd finished successfully"; \
|
|
fi
|
|
|
|
.PHONY: install-tools
|
|
install-tools:
|
|
go get -u golang.org/x/lint/golint
|
|
go get -u golang.org/x/tools/cmd/cover
|
|
go get -u golang.org/x/tools/cmd/goimports
|
|
go get -u github.com/rakyll/embedmd
|