Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v3): API finalization #369

Open
wants to merge 10 commits into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 47 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,64 @@
# Golang CircleCI 2.0 configuration file
# Golang CircleCI 2.1 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
version: 2
version: 2.1
commands:
influxdb-onboarding:
steps:
- run:
name: "Post onBoarding request to InfluxDB 2"
command: ./scripts/influxdb-onboarding.sh
collect-coverage-reports:
steps:
- run:
name: Collecting coverage reports
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
curl -s https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x ./codecov
./codecov
jobs:
build:
lint:
docker:
# specify the version
- image: cimg/go:1.17.2
- image: cimg/go:1.17
environment:
ENV: CI
GO111MODULE: "on"
steps:
- checkout
- run: go get -v -t -d ./...
- run: go vet ./...
- run: go get honnef.co/go/tools/cmd/staticcheck && staticcheck --checks="all" ./...
- run:
name: "Create a temp directory for artifacts"
command: |
mkdir -p /tmp/artifacts
mkdir -p /tmp/test-results
- run:
command: |
gotestsum --junitfile /tmp/test-results/unit-tests.xml -- -race -coverprofile=coverage.txt -covermode=atomic ./...
bash <(curl -s https://codecov.io/bash)
go tool cover -html=coverage.txt -o /tmp/artifacts/coverage.html
- run: make lint
tests:
docker:
- image: cimg/go:1.17
environment:
ENV: CI
GO111MODULE: "on"
- image: influxdb:latest
environment:
INFLUXD_HTTP_BIND_ADDRESS: :8086
steps:
- checkout
- influxdb-onboarding
- run: make coverage
- collect-coverage-reports
- store_artifacts:
path: /tmp/artifacts
- store_artifacts:
path: /tmp/test-results
destination: raw-test-output
- store_test_results:
path: /tmp/test-results
path: /tmp/test-results
workflows:
version: 2
build-test:
jobs:
- lint
- tests:
requires:
- lint
228 changes: 203 additions & 25 deletions CHANGELOG.md

Large diffs are not rendered by default.

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 -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
Loading