2019-12-18 22:57:08 +00:00
|
|
|
version: "2.1"
|
2019-12-11 03:45:25 +00:00
|
|
|
|
|
|
|
commands:
|
|
|
|
install_rust_compiler:
|
|
|
|
description: >
|
|
|
|
This will install the rust compiler with the rust tools.
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Install clang
|
|
|
|
command: sudo apt-get install -y --no-install-recommends clang
|
|
|
|
- run:
|
|
|
|
name: Install rust compiler
|
|
|
|
command: |
|
|
|
|
curl https://sh.rustup.rs -sSf | \
|
|
|
|
sh -s -- --default-toolchain stable -y
|
|
|
|
echo 'source $HOME/.cargo/env' >> $BASH_ENV
|
2019-02-08 01:21:56 +00:00
|
|
|
|
2020-05-29 15:02:56 +00:00
|
|
|
install_release_tools:
|
|
|
|
description: >
|
|
|
|
This will install the cross compilers necessary to build release binaries.
|
|
|
|
steps:
|
|
|
|
- run:
|
2020-06-10 03:45:13 +00:00
|
|
|
name: Install linux cross compilers
|
2020-05-29 15:02:56 +00:00
|
|
|
command: >
|
|
|
|
sudo apt-get install -y --no-install-recommends
|
|
|
|
gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
|
|
|
|
gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
2020-06-10 03:45:13 +00:00
|
|
|
- run:
|
|
|
|
name: Install macOS cross compilers
|
|
|
|
command: |
|
2020-06-11 19:29:47 +00:00
|
|
|
sudo apt-get install -y --no-install-recommends \
|
|
|
|
cmake patch libxml2-dev libssl-dev zlib1g-dev
|
2020-06-11 18:10:38 +00:00
|
|
|
sudo mkdir -p /opt/osxcross
|
2020-06-10 03:45:13 +00:00
|
|
|
cd /opt
|
2020-06-11 18:10:38 +00:00
|
|
|
sudo git clone https://github.com/tpoechtrager/osxcross.git
|
2020-06-10 03:45:13 +00:00
|
|
|
cd osxcross
|
2020-06-11 18:10:38 +00:00
|
|
|
sudo git checkout c2ad5e859d12a295c3f686a15bd7181a165bfa82
|
|
|
|
sudo curl -L -o \
|
2020-06-10 03:45:13 +00:00
|
|
|
./tarballs/MacOSX10.11.sdk.tar.xz \
|
|
|
|
https://macos-sdks.s3.amazonaws.com/MacOSX10.11.sdk.tar.xz
|
2020-06-11 19:29:47 +00:00
|
|
|
sudo UNATTENDED=1 PORTABLE=true ./build.sh
|
2020-05-29 15:02:56 +00:00
|
|
|
- run:
|
|
|
|
name: Install additional rust targets
|
|
|
|
command: |
|
|
|
|
rustup target add aarch64-unknown-linux-gnu \
|
|
|
|
arm-unknown-linux-gnueabihf \
|
2020-06-10 03:45:13 +00:00
|
|
|
armv7-unknown-linux-gnueabihf \
|
|
|
|
x86_64-apple-darwin
|
2020-05-29 15:02:56 +00:00
|
|
|
echo 'export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=gcc' >> $HOME/.cargo/env
|
|
|
|
echo 'export CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc' >> $HOME/.cargo/env
|
|
|
|
echo 'export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc' >> $HOME/.cargo/env
|
|
|
|
echo 'export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc' >> $HOME/.cargo/env
|
2020-06-11 22:52:59 +00:00
|
|
|
echo 'export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=/opt/osxcross/target/bin/o64-clang' >> $HOME/.cargo/env
|
2020-05-29 15:02:56 +00:00
|
|
|
- run:
|
|
|
|
name: Install pkg-config wrapper
|
|
|
|
command: go build -o /go/bin/pkg-config github.com/influxdata/pkg-config
|
|
|
|
- run:
|
|
|
|
name: Copy xcc wrapper script for cross compilation
|
|
|
|
command: install xcc.sh /go/bin/xcc
|
|
|
|
|
2018-05-16 15:43:33 +00:00
|
|
|
jobs:
|
2019-02-08 01:21:56 +00:00
|
|
|
litmus_daily:
|
|
|
|
machine: true
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: ~/project
|
|
|
|
- run: docker login -u=$QUAY_USER -p=$QUAY_PASS quay.io
|
2019-04-01 21:09:19 +00:00
|
|
|
- run: docker run --entrypoint "./run_litmus_tests_oss.sh" -e ONE_TEST=src/cloud/rest_api/smoke/test_smoke.py -e BINARYPATH=/Litmus/result/bin/linux/influxd -e BOLTPATH=/Litmus/result/influxd_test/influxd.bolt -e ENGINEPATH=/Litmus/result/influxd_test --net host -v /var/run/docker.sock:/var/run/docker.sock -v ~/project:/Litmus/result quay.io/influxdb/litmus:latest
|
2019-02-08 01:21:56 +00:00
|
|
|
- run:
|
|
|
|
name: Litmus Smoke Tests Success
|
|
|
|
when: on_success
|
|
|
|
command: bash ~/project/etc/litmus_success_notify.sh Smoke
|
|
|
|
path: ~/project
|
|
|
|
- run:
|
|
|
|
name: Litmus Smoke Tests Fail
|
|
|
|
when: on_fail
|
|
|
|
command: bash ~/project/etc/litmus_fail_notify.sh Smoke
|
|
|
|
- store_artifacts:
|
|
|
|
path: ~/project
|
2019-05-01 20:54:27 +00:00
|
|
|
destination: raw-daily-output
|
|
|
|
- store_test_results:
|
|
|
|
path: ~/project
|
|
|
|
destination: daily-junit
|
2020-03-16 20:41:13 +00:00
|
|
|
litmus_integration:
|
|
|
|
machine: true
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: ~/project
|
|
|
|
- run: docker login -u=$QUAY_USER -p=$QUAY_PASS quay.io
|
2020-03-18 23:48:54 +00:00
|
|
|
- run: docker run --entrypoint "./run_litmus_tests_oss.sh" -e TEST_LIST=tests_lists/gateway_api_tests.list -e INFLUXPATH=/Litmus/result/bin/linux/influx -e BINARYPATH=/Litmus/result/bin/linux/influxd -e BOLTPATH=/tmp/influxd_test/influxd.bolt -e ENGINEPATH=/tmp/influxd_test --net host -v /var/run/docker.sock:/var/run/docker.sock -v ~/project:/Litmus/result quay.io/influxdb/litmus:latest
|
2020-03-16 20:41:13 +00:00
|
|
|
- run:
|
2020-03-17 03:12:38 +00:00
|
|
|
name: Litmus Integration Tests Success
|
2020-03-16 20:41:13 +00:00
|
|
|
when: on_success
|
|
|
|
command: bash ~/project/etc/litmus_success_notify.sh Integration
|
|
|
|
- run:
|
|
|
|
name: Litmus Integration Tests Failure
|
|
|
|
when: on_fail
|
|
|
|
command: bash ~/project/etc/litmus_fail_notify.sh Integration
|
|
|
|
- store_artifacts:
|
|
|
|
path: ~/project
|
|
|
|
destination: raw-daily-output
|
|
|
|
- store_test_results:
|
|
|
|
path: ~/project
|
|
|
|
destination: daily-junit
|
2019-01-25 20:18:56 +00:00
|
|
|
litmus_nightly:
|
|
|
|
machine: true
|
|
|
|
steps:
|
2019-02-09 00:55:45 +00:00
|
|
|
- attach_workspace:
|
|
|
|
at: ~/project
|
2019-01-25 20:18:56 +00:00
|
|
|
- run: docker login -u=$QUAY_USER -p=$QUAY_PASS quay.io
|
2019-02-08 01:21:56 +00:00
|
|
|
- run: docker run --entrypoint "./run_litmus_tests_oss.sh" -e TEST_LIST=tests_lists/gateway_api_tests.list -e DOCKERIMAGE=true --net host -v /var/run/docker.sock:/var/run/docker.sock -v ~/project:/Litmus/result quay.io/influxdb/litmus:latest
|
2019-01-31 23:13:34 +00:00
|
|
|
- run:
|
|
|
|
name: Litmus Nightly Tests Success
|
|
|
|
when: on_success
|
2019-02-08 01:21:56 +00:00
|
|
|
command: bash ~/project/etc/litmus_success_notify.sh Nightly
|
2019-01-31 23:13:34 +00:00
|
|
|
- run:
|
|
|
|
name: Litmus Nightly Tests Fail
|
|
|
|
when: on_fail
|
2019-02-08 01:21:56 +00:00
|
|
|
command: bash ~/project/etc/litmus_fail_notify.sh Nightly
|
2019-01-25 20:18:56 +00:00
|
|
|
- store_artifacts:
|
|
|
|
path: ~/project
|
2019-05-01 20:54:27 +00:00
|
|
|
destination: raw-nightly-output
|
|
|
|
- store_test_results:
|
|
|
|
path: ~/project
|
|
|
|
destination: nightly-junit
|
2019-02-19 23:47:19 +00:00
|
|
|
e2e:
|
|
|
|
docker:
|
2020-01-06 22:19:25 +00:00
|
|
|
- image: circleci/golang:1.13-node-browsers
|
2019-02-19 23:47:19 +00:00
|
|
|
environment:
|
|
|
|
GOCACHE: /tmp/go-cache
|
2019-12-18 22:57:08 +00:00
|
|
|
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
2019-02-19 23:47:19 +00:00
|
|
|
working_directory: /go/src/github.com/influxdata/influxdb
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
# Speed up `make build` by restoring caches from previous runs.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOCACHE
|
|
|
|
keys:
|
|
|
|
- influxdb-gocache- # Just match the most recent Go cache.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOPATH/pkg/mod
|
|
|
|
keys:
|
|
|
|
- influxdb-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
|
|
|
|
- run: sudo apt-get install -y netcat-openbsd
|
2019-07-24 21:49:57 +00:00
|
|
|
- run: sudo apt-get install -y bzr
|
2019-12-11 03:45:25 +00:00
|
|
|
- install_rust_compiler
|
2019-02-19 23:47:19 +00:00
|
|
|
- run: make protoc
|
|
|
|
- run: make build
|
|
|
|
- run:
|
|
|
|
command: ./bin/linux/influxd --store=memory --e2e-testing=true
|
|
|
|
background: true
|
|
|
|
- run: make e2e
|
|
|
|
- store_test_results:
|
|
|
|
path: ui/junit-results
|
|
|
|
destination: junit-results
|
|
|
|
- store_artifacts:
|
|
|
|
path: ui/cypress/videos
|
|
|
|
destination: videos
|
|
|
|
- store_artifacts:
|
|
|
|
path: ui/cypress/screenshots
|
|
|
|
destination: screenshots
|
2019-11-12 12:55:17 +00:00
|
|
|
selenium_accept:
|
|
|
|
docker:
|
2020-03-04 08:51:39 +00:00
|
|
|
- image: circleci/node:lts-stretch-browsers
|
2019-11-12 12:55:17 +00:00
|
|
|
- image: quay.io/influxdb/influx:nightly
|
2019-12-18 22:57:08 +00:00
|
|
|
command: [--e2e-testing=true]
|
2019-11-12 12:55:17 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
2019-12-18 22:57:08 +00:00
|
|
|
name: Environment check
|
|
|
|
command: |
|
|
|
|
git --version
|
|
|
|
node --version && npm --version
|
|
|
|
docker --version
|
|
|
|
google-chrome --version && which google-chrome && chromedriver --version && which chromedriver
|
|
|
|
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9999)" != "200" ]]; do sleep 5; done' || false
|
2019-11-12 12:55:17 +00:00
|
|
|
- run:
|
2019-12-18 22:57:08 +00:00
|
|
|
name: Selenium tests
|
|
|
|
command: |
|
|
|
|
set +e
|
2020-06-18 16:17:20 +00:00
|
|
|
cd e2e
|
2019-12-18 22:57:08 +00:00
|
|
|
npm install
|
2020-06-18 16:17:20 +00:00
|
|
|
sed -i "s/\"headless\": false/\"headless\": true/g" e2e.conf.json
|
2019-12-18 22:57:08 +00:00
|
|
|
npm test; TEST_RESULT=$?
|
|
|
|
npm run report:html
|
|
|
|
npm run report:junit
|
2020-06-18 16:17:20 +00:00
|
|
|
mkdir -p ~/e2e/test-results/cucumber
|
|
|
|
mkdir -p ~/e2e/artifacts/html
|
|
|
|
cp ~/project/e2e/report/cucumber_report.html ~/e2e/artifacts/html/cucumber_report.html
|
|
|
|
cp ~/project/e2e/report/cucumber_junit.xml ~/e2e/test-results/cucumber/report.xml
|
|
|
|
cp ~/project/e2e/report/cucumber_junit.xml ~/e2e/artifacts/report.xml
|
|
|
|
cp -r ~/project/e2e/screenshots ~/e2e/artifacts
|
2019-12-18 22:57:08 +00:00
|
|
|
ls -al
|
|
|
|
exit $TEST_RESULT
|
2019-11-12 12:55:17 +00:00
|
|
|
- store_test_results:
|
2020-06-18 16:17:20 +00:00
|
|
|
path: ~/e2e/test-results
|
2019-11-12 12:55:17 +00:00
|
|
|
- store_artifacts:
|
2020-06-18 16:17:20 +00:00
|
|
|
path: ~/e2e/artifacts
|
2018-08-27 15:34:17 +00:00
|
|
|
jstest:
|
2018-05-16 15:43:33 +00:00
|
|
|
docker:
|
2020-01-06 22:19:25 +00:00
|
|
|
- image: circleci/golang:1.13-node-browsers
|
2019-01-08 00:37:16 +00:00
|
|
|
working_directory: /go/src/github.com/influxdata/influxdb
|
2019-12-18 03:36:13 +00:00
|
|
|
parallelism: 8
|
2018-08-27 15:34:17 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2019-12-18 22:57:08 +00:00
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2020-06-17 20:34:38 +00:00
|
|
|
- 'yarn-cached-packages-{{ checksum "ui/yarn.lock" }}'
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Restore Yarn Package Cache"
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set +e
|
|
|
|
cd ui
|
2020-03-02 17:38:30 +00:00
|
|
|
yarn install
|
2020-01-17 21:41:15 +00:00
|
|
|
yarn prettier
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Install Dependencies"
|
2019-08-07 20:42:35 +00:00
|
|
|
- run: make ui_client
|
2019-12-18 03:36:13 +00:00
|
|
|
- run:
|
2019-12-18 22:57:08 +00:00
|
|
|
name: parallel jest tests
|
|
|
|
command: |
|
|
|
|
set +e
|
|
|
|
cd ui
|
|
|
|
TESTFILES=$(circleci tests glob "src/**/*.test.ts*" | circleci tests split --split-by=timings)
|
|
|
|
yarn test:circleci $TESTFILES
|
2019-12-18 03:36:13 +00:00
|
|
|
- store_test_results:
|
|
|
|
path: coverage
|
|
|
|
- store_artifacts:
|
|
|
|
path: coverage
|
|
|
|
destination: raw-test-output
|
2019-12-18 22:57:08 +00:00
|
|
|
- save_cache:
|
2020-06-17 20:34:38 +00:00
|
|
|
key: 'yarn-cached-packages-{{ checksum "ui/yarn.lock" }}'
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Save Yarn Package Cache"
|
|
|
|
paths:
|
|
|
|
- ~/.cache/yarn
|
|
|
|
jslint:
|
|
|
|
docker:
|
2020-01-06 22:19:25 +00:00
|
|
|
- image: circleci/golang:1.13-node-browsers
|
2019-12-18 22:57:08 +00:00
|
|
|
working_directory: /go/src/github.com/influxdata/influxdb
|
|
|
|
parallelism: 8
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
2020-06-17 20:34:38 +00:00
|
|
|
- 'yarn-cached-packages-{{ checksum "ui/yarn.lock" }}'
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Restore Yarn Package Cache"
|
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
set +e
|
|
|
|
cd ui
|
2020-03-02 17:38:30 +00:00
|
|
|
yarn install
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Install Dependencies"
|
|
|
|
- run: make ui_client
|
|
|
|
- run:
|
|
|
|
name: parallel eslint
|
|
|
|
command: |
|
|
|
|
set +e
|
|
|
|
cd ui
|
|
|
|
TESTFILES=$(circleci tests glob "src/**/*.ts*" "cypress/**/*.ts*" | circleci tests split --split-by=filesize)
|
|
|
|
yarn eslint:circleci $TESTFILES
|
|
|
|
- save_cache:
|
2020-06-17 20:34:38 +00:00
|
|
|
key: 'yarn-cached-packages-{{ checksum "ui/yarn.lock" }}'
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Save Yarn Package Cache"
|
|
|
|
paths:
|
|
|
|
- ~/.cache/yarn
|
2018-08-27 15:34:17 +00:00
|
|
|
gotest:
|
|
|
|
docker:
|
2020-01-06 22:19:25 +00:00
|
|
|
- image: circleci/golang:1.13
|
2020-06-29 20:39:18 +00:00
|
|
|
resource_class: large
|
ci: enable GOCACHE for Circle
With a clean GOCACHE, `make test-go` took about 30 seconds. It's hard to
tell the exact time since `make vendor` was implicitly executed in the
same block.
Now, `make test-go` uses GOCACHE and takes about 5 seconds to restore
the cache, then about 8 seconds to run through a fully cached set of
tests. If any test is actually broken or doesn't compile, this will give
us fast feedback.
But this change also runs `go test -race -count=1`, so that we fully
exercise any possible data races. That currently takes about 19 seconds.
Then finally we save GOCACHE, which has our `go test` results, and a
populated build cache for our test files, including built with the race
detector. Saving that takes about 14 seconds.
That means we took about 30 seconds originally to just run `go test
-count=1`, and now we take (5+8+19+14)=46 seconds to run plain go test
and go test with the race detector. There's probably an argument to be
made for just running with the race detector, but running both gives us
more coverage IMO, and it does allow us to run tests that aren't enabled
on race builds.
See https://circleci.com/gh/influxdata/platform/1840 for a run with full
caching.
2018-08-28 16:39:44 +00:00
|
|
|
environment:
|
|
|
|
GOCACHE: /tmp/go-cache
|
2020-06-29 20:39:18 +00:00
|
|
|
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
2019-05-01 20:54:27 +00:00
|
|
|
TEST_RESULTS: /tmp/test-results
|
2019-01-08 00:37:16 +00:00
|
|
|
working_directory: /go/src/github.com/influxdata/influxdb
|
2019-12-19 05:47:26 +00:00
|
|
|
parallelism: 8
|
2018-05-16 15:43:33 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2018-08-28 18:58:55 +00:00
|
|
|
|
|
|
|
# Populate GOCACHE.
|
ci: enable GOCACHE for Circle
With a clean GOCACHE, `make test-go` took about 30 seconds. It's hard to
tell the exact time since `make vendor` was implicitly executed in the
same block.
Now, `make test-go` uses GOCACHE and takes about 5 seconds to restore
the cache, then about 8 seconds to run through a fully cached set of
tests. If any test is actually broken or doesn't compile, this will give
us fast feedback.
But this change also runs `go test -race -count=1`, so that we fully
exercise any possible data races. That currently takes about 19 seconds.
Then finally we save GOCACHE, which has our `go test` results, and a
populated build cache for our test files, including built with the race
detector. Saving that takes about 14 seconds.
That means we took about 30 seconds originally to just run `go test
-count=1`, and now we take (5+8+19+14)=46 seconds to run plain go test
and go test with the race detector. There's probably an argument to be
made for just running with the race detector, but running both gives us
more coverage IMO, and it does allow us to run tests that aren't enabled
on race builds.
See https://circleci.com/gh/influxdata/platform/1840 for a run with full
caching.
2018-08-28 16:39:44 +00:00
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOCACHE
|
|
|
|
keys:
|
2019-01-23 20:19:05 +00:00
|
|
|
- influxdb-gocache-{{ .Branch }}-{{ .Revision }} # Matches when retrying a single run.
|
2019-02-19 23:47:19 +00:00
|
|
|
- influxdb-gocache-{{ .Branch }}- # Matches a new commit on an existing branch.
|
|
|
|
- influxdb-gocache- # Matches a new branch.
|
2018-10-11 21:11:36 +00:00
|
|
|
# Populate GOPATH/pkg.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOPATH/pkg/mod
|
|
|
|
keys:
|
2019-02-19 23:47:19 +00:00
|
|
|
- influxdb-gomod-{{ checksum "go.sum" }} # Matches based on go.sum checksum.
|
2019-07-24 21:33:34 +00:00
|
|
|
- run: sudo apt-get install -y bzr
|
2019-12-11 03:45:25 +00:00
|
|
|
- install_rust_compiler
|
2019-05-01 20:54:27 +00:00
|
|
|
- run: mkdir -p $TEST_RESULTS
|
2018-08-28 18:58:55 +00:00
|
|
|
- run: make test-go # This uses the test cache so it may succeed or fail quickly.
|
2019-12-19 05:47:26 +00:00
|
|
|
- run:
|
|
|
|
name: parallel go race tests
|
|
|
|
command: |
|
|
|
|
set +e
|
|
|
|
# filter internal/promqltests because it has special go.mod
|
|
|
|
TESTFILES=$(go list ./... | grep -v internal/promqltests | circleci tests split --split-by=timings)
|
|
|
|
echo $TESTFILES
|
2020-02-28 17:08:21 +00:00
|
|
|
GOTRACEBACK=all GO111MODULE=on ./env gotestsum --format standard-quiet --junitfile /tmp/test-results/gotestsum.xml -- -race -count=1 $TESTFILES
|
2019-12-18 22:57:08 +00:00
|
|
|
- save_cache:
|
|
|
|
name: Saving GOCACHE
|
|
|
|
key: influxdb-gocache-{{ .Branch }}-{{ .Revision }}
|
|
|
|
paths:
|
|
|
|
- /tmp/go-cache
|
|
|
|
when: always
|
|
|
|
- save_cache:
|
|
|
|
name: Saving GOPATH/pkg/mod
|
|
|
|
key: influxdb-gomod-{{ checksum "go.sum" }}
|
|
|
|
paths:
|
|
|
|
- /go/pkg/mod
|
|
|
|
when: always
|
|
|
|
- store_artifacts: # Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
|
|
|
|
path: /tmp/test-results
|
|
|
|
destination: raw-test-output
|
|
|
|
- store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
|
|
|
|
path: /tmp/test-results
|
2020-04-30 15:29:43 +00:00
|
|
|
|
|
|
|
lint-feature-flags:
|
|
|
|
docker:
|
|
|
|
- image: circleci/golang:1.13
|
|
|
|
environment:
|
|
|
|
GOCACHE: /tmp/go-cache
|
|
|
|
GOFLAGS: "-mod=readonly -p=2" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
|
|
|
working_directory: /go/src/github.com/influxdata/influxdb
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
# Populate GOCACHE.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOCACHE
|
|
|
|
keys:
|
|
|
|
- influxdb-gocache-{{ .Branch }}-{{ .Revision }} # Matches when retrying a single run.
|
|
|
|
- influxdb-gocache-{{ .Branch }}- # Matches a new commit on an existing branch.
|
|
|
|
- influxdb-gocache- # Matches a new branch.
|
|
|
|
# Populate GOPATH/pkg.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOPATH/pkg/mod
|
|
|
|
keys:
|
|
|
|
- influxdb-gomod-{{ checksum "go.sum" }} # Matches based on go.sum checksum.
|
|
|
|
- run: ./scripts/ci/lint/flags.bash
|
|
|
|
- skip_if_not_master
|
|
|
|
- save_cache:
|
|
|
|
name: Saving GOCACHE
|
|
|
|
key: influxdb-gocache-{{ .Branch }}-{{ .Revision }}
|
|
|
|
paths:
|
|
|
|
- /tmp/go-cache
|
|
|
|
when: always
|
|
|
|
- save_cache:
|
|
|
|
name: Saving GOPATH/pkg/mod
|
|
|
|
key: influxdb-gomod-{{ checksum "go.sum" }}
|
|
|
|
paths:
|
|
|
|
- /go/pkg/mod
|
|
|
|
when: always
|
2019-12-18 22:57:08 +00:00
|
|
|
golint:
|
|
|
|
docker:
|
2020-01-06 22:19:25 +00:00
|
|
|
- image: circleci/golang:1.13
|
2019-12-18 22:57:08 +00:00
|
|
|
environment:
|
|
|
|
GOCACHE: /tmp/go-cache
|
|
|
|
GOFLAGS: "-mod=readonly -p=2" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
|
|
|
TEST_RESULTS: /tmp/test-results
|
|
|
|
working_directory: /go/src/github.com/influxdata/influxdb
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
# Populate GOCACHE.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOCACHE
|
|
|
|
keys:
|
|
|
|
- influxdb-gocache-{{ .Branch }}-{{ .Revision }} # Matches when retrying a single run.
|
|
|
|
- influxdb-gocache-{{ .Branch }}- # Matches a new commit on an existing branch.
|
|
|
|
- influxdb-gocache- # Matches a new branch.
|
|
|
|
# Populate GOPATH/pkg.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOPATH/pkg/mod
|
|
|
|
keys:
|
|
|
|
- influxdb-gomod-{{ checksum "go.sum" }} # Matches based on go.sum checksum.
|
|
|
|
- run: sudo apt-get install -y bzr
|
|
|
|
- install_rust_compiler
|
|
|
|
- run: mkdir -p $TEST_RESULTS
|
2020-01-06 22:19:25 +00:00
|
|
|
- run: |
|
|
|
|
# this is not in a seperate bash script because it isn't meant to be run on local.
|
|
|
|
# it just checks to make sure that the same major/minor version of go is used in the mod file as on ci
|
|
|
|
# to prevent accidentally checking in a wrong go mod version.
|
|
|
|
gomodversiondiff=$( go mod edit -go=$( go version | sed -n 's/^.*go\([0-9]*.[0-9]*\).*$/\1/p') -print |diff - go.mod )
|
|
|
|
if [ "$gomodversiondiff" ]
|
|
|
|
then
|
|
|
|
echo unexpected go version $gomodversiondiff
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-05-22 22:19:04 +00:00
|
|
|
- run: make vet
|
2018-10-08 18:16:06 +00:00
|
|
|
- run: make checkfmt
|
2018-10-10 16:31:37 +00:00
|
|
|
- run: make checktidy
|
2018-12-12 17:07:42 +00:00
|
|
|
- run: GO111MODULE=on go mod vendor # staticcheck looks in vendor for dependencies.
|
2018-11-20 19:02:13 +00:00
|
|
|
- run: GO111MODULE=on go install honnef.co/go/tools/cmd/staticcheck # Install staticcheck from the version we specify in go.mod.
|
2020-02-19 15:59:05 +00:00
|
|
|
- run: GO111MODULE=on ./env staticcheck ./...
|
ci: enable GOCACHE for Circle
With a clean GOCACHE, `make test-go` took about 30 seconds. It's hard to
tell the exact time since `make vendor` was implicitly executed in the
same block.
Now, `make test-go` uses GOCACHE and takes about 5 seconds to restore
the cache, then about 8 seconds to run through a fully cached set of
tests. If any test is actually broken or doesn't compile, this will give
us fast feedback.
But this change also runs `go test -race -count=1`, so that we fully
exercise any possible data races. That currently takes about 19 seconds.
Then finally we save GOCACHE, which has our `go test` results, and a
populated build cache for our test files, including built with the race
detector. Saving that takes about 14 seconds.
That means we took about 30 seconds originally to just run `go test
-count=1`, and now we take (5+8+19+14)=46 seconds to run plain go test
and go test with the race detector. There's probably an argument to be
made for just running with the race detector, but running both gives us
more coverage IMO, and it does allow us to run tests that aren't enabled
on race builds.
See https://circleci.com/gh/influxdata/platform/1840 for a run with full
caching.
2018-08-28 16:39:44 +00:00
|
|
|
- save_cache:
|
|
|
|
name: Saving GOCACHE
|
2019-01-23 20:19:05 +00:00
|
|
|
key: influxdb-gocache-{{ .Branch }}-{{ .Revision }}
|
ci: enable GOCACHE for Circle
With a clean GOCACHE, `make test-go` took about 30 seconds. It's hard to
tell the exact time since `make vendor` was implicitly executed in the
same block.
Now, `make test-go` uses GOCACHE and takes about 5 seconds to restore
the cache, then about 8 seconds to run through a fully cached set of
tests. If any test is actually broken or doesn't compile, this will give
us fast feedback.
But this change also runs `go test -race -count=1`, so that we fully
exercise any possible data races. That currently takes about 19 seconds.
Then finally we save GOCACHE, which has our `go test` results, and a
populated build cache for our test files, including built with the race
detector. Saving that takes about 14 seconds.
That means we took about 30 seconds originally to just run `go test
-count=1`, and now we take (5+8+19+14)=46 seconds to run plain go test
and go test with the race detector. There's probably an argument to be
made for just running with the race detector, but running both gives us
more coverage IMO, and it does allow us to run tests that aren't enabled
on race builds.
See https://circleci.com/gh/influxdata/platform/1840 for a run with full
caching.
2018-08-28 16:39:44 +00:00
|
|
|
paths:
|
|
|
|
- /tmp/go-cache
|
|
|
|
when: always
|
2018-10-11 21:11:36 +00:00
|
|
|
- save_cache:
|
|
|
|
name: Saving GOPATH/pkg/mod
|
2019-01-23 20:19:05 +00:00
|
|
|
key: influxdb-gomod-{{ checksum "go.sum" }}
|
2018-10-11 21:11:36 +00:00
|
|
|
paths:
|
|
|
|
- /go/pkg/mod
|
|
|
|
when: always
|
2019-12-18 22:57:08 +00:00
|
|
|
- store_artifacts:
|
2019-05-01 20:54:27 +00:00
|
|
|
path: /tmp/test-results
|
|
|
|
destination: raw-test-output
|
2019-12-18 22:57:08 +00:00
|
|
|
- store_test_results:
|
2019-05-01 20:54:27 +00:00
|
|
|
path: /tmp/test-results
|
2018-12-20 17:13:41 +00:00
|
|
|
build:
|
|
|
|
docker:
|
2020-01-06 22:19:25 +00:00
|
|
|
- image: circleci/golang:1.13-node-browsers
|
2018-12-20 17:13:41 +00:00
|
|
|
environment:
|
|
|
|
GOCACHE: /tmp/go-cache
|
2019-12-18 22:57:08 +00:00
|
|
|
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
2019-01-08 00:37:16 +00:00
|
|
|
working_directory: /go/src/github.com/influxdata/influxdb
|
2018-12-20 17:13:41 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2019-07-24 21:49:57 +00:00
|
|
|
- run: sudo apt-get install -y bzr
|
2019-12-11 03:45:25 +00:00
|
|
|
- install_rust_compiler
|
2019-03-13 22:48:30 +00:00
|
|
|
- run: make checkcommit
|
2018-12-20 17:13:41 +00:00
|
|
|
|
|
|
|
# Speed up `make build` by restoring caches from previous runs.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOCACHE
|
|
|
|
keys:
|
2019-01-23 20:19:05 +00:00
|
|
|
- influxdb-gocache- # Just match the most recent Go cache.
|
2018-12-20 17:13:41 +00:00
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOPATH/pkg/mod
|
|
|
|
keys:
|
2019-01-23 20:19:05 +00:00
|
|
|
- influxdb-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
|
2019-02-19 23:47:19 +00:00
|
|
|
- run: make protoc
|
2018-12-20 17:13:41 +00:00
|
|
|
- run: make build
|
2019-02-08 01:21:56 +00:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
2019-02-19 23:47:19 +00:00
|
|
|
- project
|
2019-02-08 01:21:56 +00:00
|
|
|
- bin/linux/influxd
|
|
|
|
- bin/linux/influx
|
|
|
|
- etc/litmus_success_notify.sh
|
|
|
|
- etc/litmus_fail_notify.sh
|
2019-01-23 20:19:05 +00:00
|
|
|
deploy-nightly:
|
2018-05-22 20:42:32 +00:00
|
|
|
docker:
|
2020-01-06 22:19:25 +00:00
|
|
|
- image: circleci/golang:1.13-node-browsers
|
2018-08-28 21:57:17 +00:00
|
|
|
environment:
|
|
|
|
GOCACHE: /tmp/go-cache
|
2019-12-18 22:57:08 +00:00
|
|
|
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
2019-01-08 00:37:16 +00:00
|
|
|
working_directory: /go/src/github.com/influxdata/influxdb
|
2018-05-22 20:42:32 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2018-08-28 21:57:17 +00:00
|
|
|
|
|
|
|
# Speed up `make nightly` by restoring caches from previous runs.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOCACHE
|
|
|
|
keys:
|
2019-01-23 20:19:05 +00:00
|
|
|
- influxdb-gocache- # Just match the most recent Go cache.
|
2018-10-11 21:11:36 +00:00
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOPATH/pkg/mod
|
|
|
|
keys:
|
2019-01-23 20:19:05 +00:00
|
|
|
- influxdb-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
|
2018-07-17 22:23:39 +00:00
|
|
|
- setup_remote_docker
|
2019-01-14 22:30:12 +00:00
|
|
|
- run:
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Docker Login"
|
2019-01-14 22:30:12 +00:00
|
|
|
command: docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
|
2019-07-26 21:21:14 +00:00
|
|
|
- run: sudo apt-get install -y bzr
|
2020-05-29 15:02:56 +00:00
|
|
|
- install_rust_compiler
|
|
|
|
- install_release_tools
|
2019-07-26 21:21:14 +00:00
|
|
|
- run: make protoc # installs protoc
|
2019-01-14 22:30:12 +00:00
|
|
|
- run:
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Build nightly"
|
2019-01-14 22:30:12 +00:00
|
|
|
command: make nightly
|
2019-02-10 06:57:42 +00:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: .
|
|
|
|
paths:
|
|
|
|
- etc/litmus_success_notify.sh
|
2019-02-19 23:47:19 +00:00
|
|
|
- etc/litmus_fail_notify.sh
|
2019-02-08 01:21:56 +00:00
|
|
|
|
2019-01-23 20:19:05 +00:00
|
|
|
release:
|
|
|
|
docker:
|
2020-01-06 22:19:25 +00:00
|
|
|
- image: circleci/golang:1.13-node-browsers
|
2019-01-23 20:19:05 +00:00
|
|
|
environment:
|
|
|
|
GOCACHE: /tmp/go-cache
|
2019-12-18 22:57:08 +00:00
|
|
|
GOFLAGS: "-mod=readonly -p=4" # Go on Circle thinks 32 CPUs are available, but there aren't.
|
2020-01-08 18:35:58 +00:00
|
|
|
DOCKER_VERSION: 2.0.0-beta
|
2019-01-23 20:19:05 +00:00
|
|
|
working_directory: /go/src/github.com/influxdata/influxdb
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
# Speed up `make nightly` by restoring caches from previous runs.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOCACHE
|
|
|
|
keys:
|
|
|
|
- influxdb-gocache- # Just match the most recent Go cache.
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring GOPATH/pkg/mod
|
|
|
|
keys:
|
|
|
|
- influxdb-gomod-{{ checksum "go.sum" }} # Just match the go.sum checksum cache.
|
|
|
|
- setup_remote_docker
|
|
|
|
- run:
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Docker Login"
|
2019-01-23 20:19:05 +00:00
|
|
|
command: docker login -u "$QUAY_USER" -p $QUAY_PASS quay.io
|
2019-07-25 23:46:15 +00:00
|
|
|
- run: sudo apt-get install -y bzr
|
2020-05-29 15:02:56 +00:00
|
|
|
- install_rust_compiler
|
|
|
|
- install_release_tools
|
2019-08-14 19:24:27 +00:00
|
|
|
- run: make protoc # installs protoc
|
2019-01-23 20:19:05 +00:00
|
|
|
- run:
|
2019-12-18 22:57:08 +00:00
|
|
|
name: "Build release"
|
2019-01-23 20:19:05 +00:00
|
|
|
command: make release
|
2018-05-22 20:42:32 +00:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
2018-12-20 16:34:26 +00:00
|
|
|
build:
|
2018-05-22 20:42:32 +00:00
|
|
|
jobs:
|
2018-08-27 15:34:17 +00:00
|
|
|
- gotest
|
2019-12-18 22:57:08 +00:00
|
|
|
- golint
|
2018-08-27 15:34:17 +00:00
|
|
|
- jstest
|
2019-12-18 22:57:08 +00:00
|
|
|
- jslint
|
2018-12-20 17:13:41 +00:00
|
|
|
- build
|
2019-02-08 01:21:56 +00:00
|
|
|
- litmus_daily:
|
|
|
|
requires:
|
|
|
|
- build
|
2019-02-21 20:28:38 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: /^(?!pull\/).*$/
|
2020-03-16 20:41:13 +00:00
|
|
|
- litmus_integration:
|
|
|
|
requires:
|
|
|
|
- litmus_daily
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2019-02-19 23:47:19 +00:00
|
|
|
e2e:
|
|
|
|
jobs:
|
|
|
|
- e2e
|
2020-02-26 21:03:43 +00:00
|
|
|
hourly-e2e:
|
|
|
|
triggers:
|
|
|
|
- schedule:
|
2020-05-11 16:15:48 +00:00
|
|
|
cron: "0 * * * *"
|
2020-02-26 21:03:43 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
jobs:
|
|
|
|
- e2e
|
2018-12-13 21:48:09 +00:00
|
|
|
nightly:
|
|
|
|
triggers:
|
|
|
|
- schedule:
|
2020-04-21 17:40:17 +00:00
|
|
|
cron: "0 5 * * *"
|
2018-12-13 21:48:09 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
2020-04-16 20:11:06 +00:00
|
|
|
- feat/use-algo-w
|
2018-12-13 21:48:09 +00:00
|
|
|
jobs:
|
2018-12-16 09:56:02 +00:00
|
|
|
- gotest
|
2019-12-18 22:57:08 +00:00
|
|
|
- golint
|
2018-12-16 09:56:02 +00:00
|
|
|
- jstest
|
2019-12-18 22:57:08 +00:00
|
|
|
- jslint
|
2019-01-23 20:19:05 +00:00
|
|
|
- deploy-nightly:
|
2018-12-13 21:48:09 +00:00
|
|
|
requires:
|
|
|
|
- gotest
|
2019-12-18 22:57:08 +00:00
|
|
|
- golint
|
2018-12-13 21:48:09 +00:00
|
|
|
- jstest
|
2019-12-18 22:57:08 +00:00
|
|
|
- jslint
|
2018-12-13 21:48:09 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
2020-04-16 20:11:06 +00:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- feat/use-algo-w
|
2019-01-25 20:18:56 +00:00
|
|
|
- litmus_nightly:
|
|
|
|
requires:
|
|
|
|
- deploy-nightly
|
2019-11-12 12:55:17 +00:00
|
|
|
- selenium_accept:
|
|
|
|
requires:
|
|
|
|
- deploy-nightly
|
2019-01-23 20:19:05 +00:00
|
|
|
release:
|
|
|
|
jobs:
|
2019-01-23 21:24:28 +00:00
|
|
|
- gotest:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
|
|
|
tags:
|
2020-01-08 18:35:58 +00:00
|
|
|
only: /^v[0-9]+\.[0-9]+\.[0-9]+-(alpha|beta)\.[0-9]+$/
|
2019-12-18 22:57:08 +00:00
|
|
|
- golint:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
|
|
|
tags:
|
2020-01-08 18:35:58 +00:00
|
|
|
only: /^v[0-9]+\.[0-9]+\.[0-9]+-(alpha|beta)\.[0-9]+$/
|
2019-01-23 21:24:28 +00:00
|
|
|
- jstest:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
|
|
|
tags:
|
2020-01-08 18:35:58 +00:00
|
|
|
only: /^v[0-9]+\.[0-9]+\.[0-9]+-(alpha|beta)\.[0-9]+$/
|
2019-12-18 22:57:08 +00:00
|
|
|
- jslint:
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
|
|
|
tags:
|
2020-01-08 18:35:58 +00:00
|
|
|
only: /^v[0-9]+\.[0-9]+\.[0-9]+-(alpha|beta)\.[0-9]+$/
|
2019-01-23 20:19:05 +00:00
|
|
|
- release:
|
|
|
|
requires:
|
|
|
|
- gotest
|
2019-12-18 22:57:08 +00:00
|
|
|
- golint
|
2019-01-23 20:19:05 +00:00
|
|
|
- jstest
|
2019-12-18 22:57:08 +00:00
|
|
|
- jslint
|
2019-01-23 20:19:05 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
|
|
|
tags:
|
2020-01-08 18:35:58 +00:00
|
|
|
only: /^v[0-9]+\.[0-9]+\.[0-9]+-(alpha|beta)\.[0-9]+$/
|