update CircleCI config to 2.0 syntax (#9711)

* enable flaky test, see if CircleCI fails

* Use CircleCI 2.0 with docker layer caching

* update CONTRIBUTING
pull/9737/head
Jacob Marble 2018-04-16 12:00:44 -07:00 committed by GitHub
parent 7ebfc9c544
commit 321ae4ff04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 64 deletions

19
.circleci/config.yml Normal file
View File

@ -0,0 +1,19 @@
version: 2
jobs:
build:
machine:
enabled: true
docker_layer_caching: true
environment:
- PARALLELISM: 4 # Input to influxdb/build.py
parallelism: 5 # How many CircleCI test containers
steps:
- checkout
- run:
name: Ensure CircleCI parallelism matches "./test.sh count"
command: "[ `./test.sh count` -eq $CIRCLE_NODE_TOTAL ]"
- run:
name: Execute test
command: ./test.sh $CIRCLE_NODE_INDEX
no_output_timeout: 1500s

1
.gitignore vendored
View File

@ -66,6 +66,7 @@ config.toml
# test data files
integration/migration_data/
test-logs/
# man outputs
man/*.xml

View File

@ -277,4 +277,6 @@ func BenchmarkSomething(b *testing.B) {
Continuous Integration testing
-----
InfluxDB uses CircleCI for continuous integration testing. To see how the code is built and tested, check out [this file](https://github.com/influxdata/influxdb/blob/master/circle-test.sh). It closely follows the build and test process outlined above. You can see the exact version of Go InfluxDB uses for testing by consulting that file.
InfluxDB uses CircleCI for continuous integration testing. CircleCI executes [test.sh](https://github.com/influxdata/influxdb/blob/master/test.sh), so you may do the same on your local development environment before creating a pull request.
The `test.sh` script executes a test suite with 5 variants (standard 64 bit, 64 bit with race detection, 32 bit, TSI, go version 1.9.2), each executes with a different arg, 0 through 4. Unless you know differently, `./test.sh 0` is probably all you need.

View File

@ -1,39 +0,0 @@
#!/bin/bash
#
# This is the InfluxDB test script for CircleCI, it is a light wrapper around ./test.sh.
# Exit if any command fails
set -e
# Get dir of script and make it is our working directory.
DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
cd $DIR
export OUTPUT_DIR="$CIRCLE_ARTIFACTS"
# Don't delete the container since CircleCI doesn't have permission to do so.
export DOCKER_RM="false"
# Get number of test environments.
count=$(./test.sh count)
# Check that we aren't wasting CircleCI nodes.
if [ $CIRCLE_NODE_TOTAL -gt $count ]
then
echo "More CircleCI nodes allocated than tests environments to run!"
exit 1
fi
# Map CircleCI nodes to test environments.
tests=$(seq 0 $((count - 1)))
for i in $tests
do
mine=$(( $i % $CIRCLE_NODE_TOTAL ))
if [ $mine -eq $CIRCLE_NODE_INDEX ]
then
echo "Running test env index: $i"
./test.sh $i
fi
done
# Copy the JUnit test XML to the test reports folder.
mkdir -p $CIRCLE_TEST_REPORTS/reports
cp test-results.xml $CIRCLE_TEST_REPORTS/reports/test-results.xml

View File

@ -1,23 +0,0 @@
machine:
services:
- docker
environment:
GODIST: "go1.9.2.linux-amd64.tar.gz"
post:
- mkdir -p download
- test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf download/$GODIST
dependencies:
cache_directories:
- ~/download
override:
- ./test.sh count
test:
override:
- bash circle-test.sh:
parallel: true
# Race tests using 960s timeout
timeout: 1500

View File

@ -185,7 +185,6 @@ func TestService_ModeALL(t *testing.T) {
}
func TestService_ModeANY(t *testing.T) {
t.Skip("TODO: flaky test.")
dataChanged := make(chan struct{})
ms := MetaClient{}
ms.WaitForDataChangedFn = func() chan struct{} {