This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable test coverage. * Use makefile in travis * enable addlicense and staticcheck * enable goimports * Enable coverage without package tests check * Remove addlicense * Exclude testpb package from tools. * Add a tools.go to ensure consistent version of the tools
- Loading branch information
1 parent
dd3a274
commit b5c7a2c
Showing
21 changed files
with
177 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
/vendor/ | ||
# GoLand IDEA | ||
/.idea/ | ||
*.iml | ||
|
||
# VS Code | ||
.vscode | ||
|
||
# Coverage | ||
coverage.txt | ||
coverage.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
language: go | ||
|
||
go: | ||
- 1.11.x | ||
- 1.12.x | ||
|
||
go_import_path: contrib.go.opencensus.io/exporter/stackdriver | ||
|
||
env: | ||
global: | ||
GO111MODULE=on | ||
|
||
before_script: | ||
- GO_FILES=$(find . -iname '*.go' | grep -v /vendor/) # All the .go files, excluding vendor/ if any | ||
- PKGS=$(go list ./... | grep -v /vendor/) # All the import paths, excluding vendor/ if any | ||
install: | ||
- go mod download | ||
- make install-tools | ||
|
||
script: | ||
- go build ./... # Ensure dependency updates don't break build | ||
- if [ -n "$(gofmt -s -l $GO_FILES)" ]; then echo "gofmt the following files:"; gofmt -s -l $GO_FILES; exit 1; fi | ||
- go vet ./... | ||
- go test -v -race $PKGS # Run all the tests with the race detector enabled | ||
- GO111MODULE=off go get -t ./... | ||
- GO111MODULE=off go build ./... | ||
- GO111MODULE=off go test -v -race $PKGS # Make sure tests still pass when not using Go modules. | ||
- 'if [[ $TRAVIS_GO_VERSION = 1.8* ]]; then ! golint ./... | grep -vE "(_mock|_string|\.pb)\.go:"; fi' | ||
- make travis-ci | ||
|
||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2019, OpenCensus Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
// +build tools | ||
|
||
package internal | ||
|
||
// This file follows the recommendation at | ||
// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module | ||
// on how to pin tooling dependencies to a go.mod file. | ||
// This ensures that all systems use the same version of tools in addition to regular dependencies. | ||
|
||
import ( | ||
_ "github.com/jstemmer/go-junit-report" | ||
_ "golang.org/x/lint/golint" | ||
_ "golang.org/x/tools/cmd/goimports" | ||
_ "honnef.co/go/tools/cmd/staticcheck" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.