Skip to content

Commit

Permalink
Move to Go 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Aug 27, 2015
1 parent a74f7e3 commit 31f6b46
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ second to sign our CLA, which can be found

Installing Go
-------------
InfluxDB requires Go 1.4 or greater.
InfluxDB requires Go 1.5 or greater.

At InfluxDB we find gvm, a Go version manager, useful for installing Go. For instructions
on how to install it see [the gvm page on github](https://github.com/moovweb/gvm).

After installing gvm you can install and set the default go version by
running the following:

gvm install go1.4
gvm use go1.4 --default
gvm install go1.5
gvm use go1.5 --default

Revision Control Systems
------
Expand Down Expand Up @@ -156,7 +156,7 @@ go install ./...
To set the version and commit flags during the build pass the following to the build command:

```bash
-ldflags="-X main.version $VERSION -X main.branch $BRANCH -X main.commit $COMMIT"
-ldflags="-X main.version $VERSION -X main.branch=$BRANCH -X main.commit=$COMMIT"
```

where `$VERSION` is the version, `$BRANCH` is the branch, and `$COMMIT` is the git commit hash.
Expand Down
19 changes: 11 additions & 8 deletions circle-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
# build process for InfluxDB.

BUILD_DIR=$HOME/influxdb-build
GO_VERSION=go1.4.2
GO_VERSION=go1.5
PARALLELISM="-parallel 256"
TIMEOUT="-timeout 480s"
SKIP_32BIT="true"

# Executes the given statement, and exits if the command returns a non-zero code.
function exit_if_fail {
Expand Down Expand Up @@ -57,13 +58,15 @@ case $CIRCLE_NODE_INDEX in
exit $rc
fi

# 32bit tests. (Could be run on a separate node instead)
exit_if_fail docker build -f Dockerfile_test_ubuntu32 -t ubuntu-32-influxdb-test .
docker run -v $(pwd):/root/go/src/github.com/influxdb/influxdb \
-v ${CIRCLE_ARTIFACTS}:/tmp/artifacts \
-t ubuntu-32-influxdb-test bash \
-c "cd /root/go/src/github.com/influxdb/influxdb && go get -t -d -v ./... && go build -v ./... && go test ${PARALLELISM} ${TIMEOUT} -v ./... 2>&1 | tee /tmp/artifacts/test_logs_i386.txt && exit \${PIPESTATUS[0]}"
rc=$?
if [ "$SKIP_32BIT" != "true" ]; then
# 32bit tests. (Could be run on a separate node instead)
exit_if_fail docker build -f Dockerfile_test_ubuntu32 -t ubuntu-32-influxdb-test .
docker run -v $(pwd):/root/go/src/github.com/influxdb/influxdb \
-v ${CIRCLE_ARTIFACTS}:/tmp/artifacts \
-t ubuntu-32-influxdb-test bash \
-c "cd /root/go/src/github.com/influxdb/influxdb && go get -t -d -v ./... && go build -v ./... && go test ${PARALLELISM} ${TIMEOUT} -v ./... 2>&1 | tee /tmp/artifacts/test_logs_i386.txt && exit \${PIPESTATUS[0]}"
rc=$?
fi
;;
1)
GORACE="halt_on_error=1" go test $PARALLELISM $TIMEOUT -v -race ./... 2>&1 | tee $CIRCLE_ARTIFACTS/test_logs_race.txt
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ machine:
- docker
pre:
- bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
- source $HOME/.gvm/scripts/gvm; gvm install go1.4.2 --binary
- source $HOME/.gvm/scripts/gvm; gvm install go1.5 --binary

dependencies:
override:
Expand Down
4 changes: 2 additions & 2 deletions client/influxdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ func TestClient_Timeout(t *testing.T) {
_, err = c.Query(query)
if err == nil {
t.Fatalf("unexpected success. expected timeout error")
} else if !strings.Contains(err.Error(), "use of closed network connection") {
t.Fatalf("unexpected error. expected 'use of closed network connection' error, got %v", err)
} else if !strings.Contains(err.Error(), "request canceled") {
t.Fatalf("unexpected error. expected 'request canceled' error, got %v", err)
}

confignotimeout := client.Config{URL: *u}
Expand Down
3 changes: 0 additions & 3 deletions cmd/influxd/run/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ func (cmd *Command) Run(args ...string) error {
return fmt.Errorf("write pid file: %s", err)
}

// Set parallelism.
runtime.GOMAXPROCS(runtime.NumCPU())

// Turn on block profiling to debug stuck databases
runtime.SetBlockProfileRate(int(1 * time.Second))

Expand Down
4 changes: 2 additions & 2 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if [ -z "$FPM" ]; then
FPM=`which fpm`
fi

GO_VERSION="go1.4.2"
GO_VERSION="go1.5"
GOPATH_INSTALL=
BINS=(
influxd
Expand Down Expand Up @@ -190,7 +190,7 @@ do_build() {
cleanup_exit 1
fi

go install -a -ldflags="-X main.version $version -X main.branch $branch -X main.commit $commit" ./...
go install -a -ldflags="-X main.version $version -X main.branch=$branch -X main.commit=$commit" ./...
if [ $? -ne 0 ]; then
echo "Build failed, unable to create package -- aborting"
cleanup_exit 1
Expand Down

0 comments on commit 31f6b46

Please sign in to comment.