Skip to content

Commit

Permalink
Merge pull request #345 from influxdata/feat/makefile
Browse files Browse the repository at this point in the history
test: Adding makefile for simplifying testing
  • Loading branch information
vlastahajek committed Jul 28, 2022
2 parents 6274621 + bf96de2 commit b78b862
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 16 deletions.
12 changes: 4 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,12 @@ jobs:
- run: sudo tar -C /usr/local -xzf /tmp/go.tgz
- run: go version
- run: go get -v -t -d ./...
- run: go vet ./...
- run: go install honnef.co/go/tools/cmd/staticcheck@latest && staticcheck --checks='all' --tags e2e ./...
- run: go install golang.org/x/lint/golint@latest && golint ./...
- run: make lint
- run:
name: "Start InfluxDB service"
command: ./scripts/influxdb-restart.sh
command: make server
- run:
command: |
go install gotest.tools/gotestsum@latest && gotestsum --junitfile /tmp/test-results/unit-tests.xml -- -race -coverprofile=coverage.txt -covermode=atomic -coverpkg '.,./api/...,./internal/.../,./log/...' -tags e2e ./...
go tool cover -html=coverage.txt -o /tmp/artifacts/coverage.html
command: make coverage
- run:
name: Collecting coverage reports
command: |
Expand All @@ -67,4 +63,4 @@ jobs:
path: /tmp/test-results
destination: raw-test-output
- store_test_results:
path: /tmp/test-results
path: /tmp/test-results
19 changes: 11 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
## [unreleased]
### Bug fixes
- [#341](https://github.com/influxdata/influxdb-client-go/issues/341) Changing logging level of messages about discarding batch to Error.
- [#344](https://github.com/influxdata/influxdb-client-go/issues/344) `WriteAPI.Flush()` writes also batches from the retry queue.
- [#341](https://github.com/influxdata/influxdb-client-go/pull/341) Changing logging level of messages about discarding batch to Error.
- [#344](https://github.com/influxdata/influxdb-client-go/pull/344) `WriteAPI.Flush()` writes also batches from the retry queue.

### Test
- [#345](https://github.com/influxdata/influxdb-client-go/pul/345) Added makefile for simplifing testing from command line.

## 2.9.1 [2022-06-24]
### Bug fixes
- [#332](https://github.com/influxdata/influxdb-client-go/issues/332) Retry strategy drops expired batches as soon as they expire.
- [#335](https://github.com/influxdata/influxdb-client-go/issues/335) Retry strategy keeps max retry delay for new batches.
- [#332](https://github.com/influxdata/influxdb-client-go/pull/332) Retry strategy drops expired batches as soon as they expire.
- [#335](https://github.com/influxdata/influxdb-client-go/pull/335) Retry strategy keeps max retry delay for new batches.

## 2.9.0 [2022-05-20]
### Features
- [#323](https://github.com/influxdata/influxdb-client-go/pull/323) Added `TasksAPI.CreateTaskByFlux` to allow full control of task script.
- [#328](https://github.com/influxdata/influxdb-client-go/pull/328) Added `Client.SetupWithToken` allowing to specify a custom token.

### Bug fixes
- [#324](https://github.com/influxdata/influxdb-client-go/issues/324) Non-empty error channel will not block writes
- [#324](https://github.com/influxdata/influxdb-client-go/pull/324) Non-empty error channel will not block writes

## 2.8.2 [2022-04-19]
### Bug fixes
Expand Down Expand Up @@ -97,7 +100,7 @@
### Bug fixes
1. [#252](https://github.com/influxdata/influxdb-client-go/pull/252) Fixed panic when getting not present standard Flux columns
1. [#253](https://github.com/influxdata/influxdb-client-go/pull/253) Conditional debug logging of buffers
1. [#254](https://github.com/influxdata/influxdb-client-go/pull/254) Fixed golint issues
1. [#254](https://github.com/influxdata/influxdb-client-go/pull/254) Fixed golint pull

## 2.2.3 [2021-04-01]
### Bug fixes
Expand Down Expand Up @@ -193,8 +196,8 @@
1. [#124](https://github.com/influxdata/influxdb-client-go/pull/124) Buckets API

### Bug fixes
1. [#108](https://github.com/influxdata/influxdb-client-go/issues/108) Fix default retry interval doc
1. [#110](https://github.com/influxdata/influxdb-client-go/issues/110) Allowing empty (nil) values in query result
1. [#108](https://github.com/influxdata/influxdb-client-go/pull/108) Fix default retry interval doc
1. [#110](https://github.com/influxdata/influxdb-client-go/pull/110) Allowing empty (nil) values in query result

### Documentation
- [#112](https://github.com/influxdata/influxdb-client-go/pull/112) Clarify how to use client with InfluxDB 1.8+
Expand Down
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
artifacts_path := /tmp/artifacts

help:
@echo 'Targets:'
@echo ' all - runs lint, server, coverage'
@echo ' lint - runs code style checks'
@echo ' shorttest - runs unit and integration tests'
@echo ' test - runs all tests, including e2e tests - requires running influxdb 2 server'
@echo ' coverage - runs all tests, including e2e tests, with coverage report - requires running influxdb 2 server'
@echo ' server - prepares InfluxDB in docker environment'

lint:
go vet ./...
go install honnef.co/go/tools/cmd/staticcheck@latest && staticcheck --checks='all' --tags e2e ./...
go install golang.org/x/lint/golint@latest && golint ./...

shorttest:
go test -race -v -count=1 ./...

test:
go test -race -v -count=1 --tags e2e ./...

coverage:
go install gotest.tools/gotestsum@latest && gotestsum --junitfile /tmp/test-results/unit-tests.xml -- -race -coverprofile=coverage.txt -covermode=atomic -coverpkg '.,./api/...,./internal/.../,./log/...' -tags e2e ./...
if test ! -e $(artifacts_path); then mkdir $(artifacts_path); fi
go tool cover -html=coverage.txt -o $(artifacts_path)/coverage.html

server:
./scripts/influxdb-restart.sh

all: lint server coverage

0 comments on commit b78b862

Please sign in to comment.