1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-02 08:52:21 +02:00
Commit Graph

22 Commits

Author SHA1 Message Date
Krzesimir Nowak
027855962b Some makefile fixes (#442)
* Generate and build before linting

Generated files may require some formatting that happens during
linting. Also missing generated files may result in linter failures.

Building can shake out any syntax/semantic errors and report them in a
much nicer way than the linter does. Which is exactly the reason the
build was running before linters before the Makefile simplification.

* Make stringer tool a dep of generate target, not lint

Lint target does not use the stringer utility - it is being used by go
generate.
2020-01-24 12:06:24 -08:00
rghetia
f0eb35b918
exclude example dirs from coverage test/report. (#365) 2019-12-02 23:58:53 -08:00
ferhat elmas
f25c84f35f Fix lint target (#360) 2019-11-27 23:20:33 -08:00
ferhat elmas
921ea03c0d Drop GO111MODULE environment variable (#359) 2019-11-27 16:29:56 -08:00
Isobel Redelmeier
e6d725626d Simplify Makefile (#354)
* Simplify Makefile

In particular, this change:
* Ensures that the race checker is always used for all tests
* Removes redundant commands
* Splits out `generate` and `lint` as their own commands
* Renames the `circle-ci` command to the more generic `ci`

* Use GOTEST_WITH_COVERAGE instead of old name

* Fix test-with-coverage command

* Fix test-386 command
2019-11-27 11:27:41 -08:00
Joshua MacDonald
799a4180bd
Fix race conditions in push_test.go (#340)
* Fix race conditions in push_test.go

* Add circle race test
2019-11-22 10:48:53 -08:00
Krzesimir Nowak
a2f3dcaf9a build all tests and run all tests too (#254)
golangci-lint runs its checks also on tests files, so make sure that
they build properly before running the linter. there is no obvious
solution to just build all the test without running them, so to work
that around, we specify a -run flag with a value that surely isn't
going to match any test function any time soon. that way we build all
the tests, but no test is run.

also, `go list ./...` returns only packages in the module, but no
packages within submodule, so exporter/trace/jaeger (which is a
submodule) was never on the list. so go test with those packages never
ran the jaeger trace exporter tests. fix this by visiting every
directory with the go.mod file and calling go test [options]
./... therein.
2019-10-30 10:09:18 -07:00
Krzesimir Nowak
cdf3f492d1 run go build on all modules to catch compilation errors (#250)
golangci-lint just issues an unreadable warning and quits with a
successful exit status on compilation error. just run a round of go
build ./... to catch those as hard errors.
2019-10-29 21:32:18 -07:00
Joshua MacDonald
937f4ff8b0
Metrics SDK work-in-progress (#172)
Introduce the new SDK, four aggregators, and an export interface.
2019-10-29 13:27:22 -07:00
Krzesimir Nowak
7d301220a2 Automate getting the list of examples to build (and switch to go 1.13 to avoid module problems) (#246)
* automate building all the examples

the EXAMPLES variable was out of date - the stackdriver example wasn't
even built

let's automate it, so we don't need to remember about updating the
variable after adding a new example to the examples directory

* move jaeger example to example directory

this should be in the examples directory, so it can be built by the
make test during CI.

* switch to go 1.13

circle ci uses go 1.12 (which is the oldest 1.12 release) that
contains some bugs with module handling

let's switch to go 1.13.3, the latest go currently

* use a single valid revision of the project in go.mod files

this probably shouldn't be a problem since the switch to go 1.13 in
circle ci, but cleans up the mess and the use of bogus releases
2019-10-29 08:45:48 -07:00
Joshua MacDonald
0025ffcc71
Remove the experimental SDK (#221)
* Remove the experimental SDK

* Remove the experimental SDK from README.md

* Remove the experimental SDK from Makefile
2019-10-17 14:21:50 -07:00
Krzesimir Nowak
a936b8fb00 Add some docs about useful step before filing a PR (#151)
* Add a document about contributing

It is shamelessly stolen from opentelemetry-python and edited to be
relevant to opentelemetry-go. This file should explain some less
obvious things about the development of the project, like running
linters and regenerating the files.

* Force the use of go modules

Until go 1.13 modules were disabled by default if the repository was
inside GOPATH. This was causing issues when running `make precommit`
for the first time, as it could not find sources for any of the tools
used in `make precommit` under `${GOPATH}/src`. With setting the
`GO111MODULE` environment variable to `on`, we tell `go` to behave
differently, just like go 1.13 does by default.
2019-10-01 09:16:45 -07:00
Krzesimir Nowak
908b73d792 run golangci-lint in all directories with go.mod (#138)
* Run golangci-lint in all directories with go.mod

* Imports fix by golangci-lint

* Propagate failures from commands running in loops
2019-09-25 09:38:55 -07:00
Joshua MacDonald
a3ae50d8bc
Remove experimental/streaming globals, add streaming example (#135)
* Remove globals from exp/streaming

* basic example

* Build the streaming example

* Update README.md for running streaming example

* Remove observer package

* Move observer to exporter

* Fix

* Re-run make circle-ci
2019-09-23 14:39:10 -07:00
rghetia
b13362e37c
replace -printf option with -exec in find cmd for go.mod directories. (#139) 2019-09-23 11:04:55 -07:00
Krzesimir Nowak
0583d26d0b Build example and ensure go mod files are tidy (#131)
* Build examples when running tests

* Run go mod tidy in precommit

That way CI can catch the case when go.mod or go.sum are outdated.
2019-09-19 09:16:09 -07:00
Krzesimir Nowak
8d93efab11 Run go generate during make and make sure that generated files are in sync in CI (#101)
* Run go generate in the precommit target

So we should always get an updated version of a file generated by a
stringer utility.

* Update the generated file

* Make CI to fail if working tree has uncommited changes

The uncommitted changes may come from the golang linter (that formats
our code among other things) and from stringer (when updated some
enumeration).
2019-08-22 11:16:51 -07:00
Edward Muller
623b062e17 Forgot this removal in my last PR. (#84)
goimports is no longer in tools.go and should have been removed from
the Makefile.
2019-08-07 14:33:39 -07:00
Edward Muller
99906da7a6 Misc Makefile and README.md updates (#78)
Enabling misspell and goimports in golangci-lint allows a bit of
simplification of tools.go / Makefile.

The linters enabled locally also complained about the markdown in
README.md a little, so I fixed those complaints.

I also enabled auto-fix mode in golangci-lint so that it will just
fix any lint issues it runs across (which is how goimports/misspell)
was being used.

misspell still needs to be included in tools.go unless we decide that
we didn't want it to run on markdown files.
2019-08-05 13:58:24 -07:00
rghetia
ed3b26b6c8
add misspell tool fix common spelling mistakes. (#69) 2019-08-02 10:44:32 -07:00
rghetia
20b2f718b8
Add Circle ci (#41)
* fix compile errors.

* fix lint errors.

* add circle-ci job.

* rename IDHigh to TraceIDHigh

* rename the file.

* add go get for goimports and golangci-lint

* enable GO111MODULE and remove comments.

* remove working dir and update cache name

* Add TEST_RESULT env back.

* run go mod tidy.

* remove go mod download.

* add test coverage.

* fix TraceID.

* fix circlefi config error.

* remove install-tools.

* remove ALL_TEST_SRC from Makefile.
2019-07-02 16:21:24 -07:00
Edward Muller
063035e9e0 Add goimports and golangci-lint (#17)
goimports for import rewritting
golangci-lint as the configurable linting swiss army knife.

These tools are recorded in [tools.go](https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module). This records
them as a dependency to make sure we're all using the same tool versions.

To make sure this project's tool's versions don't stomp over versions
from other projects, they are installed in ./.tools, which is
.gitignored.

goimports was run and fixed up a single file:
plugin/httptrace/httptrace.go

I prefer to group local packages below external packages, hence the use
of goimports -local option.

.golangci.yml contains nothing but an incomplete set of defaults ATM.
I expect those to change over time though. ;-)

To use, run:

$ make precommit

Fixes #15
2019-06-18 17:09:49 -07:00