From 5a651974db598a3390e58cc76efdadd9b6a5eb12 Mon Sep 17 00:00:00 2001 From: Ian Babrou Date: Tue, 1 Jul 2014 22:48:10 +0400 Subject: [PATCH] added travis-ci file --- .travis.yml | 22 ++++++++++++++++++++++ goes_test.go | 10 ++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..69123d3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: go + +go: + - 1.1 + - 1.2 + - 1.3 + - tip + +env: + matrix: + - ES_VERSION=1.0.3 + - ES_VERSION=1.1.2 + - ES_VERSION=1.2.1 + +before_script: + - mkdir ${HOME}/elasticsearch + - wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz + - tar -xzf elasticsearch-${ES_VERSION}.tar.gz -C ${HOME}/elasticsearch + - ${HOME}/elasticsearch/elasticsearch-${ES_VERSION}/bin/elasticsearch >/dev/null & + +script: + - make test diff --git a/goes_test.go b/goes_test.go index 20ac725..0d71e9f 100644 --- a/goes_test.go +++ b/goes_test.go @@ -585,11 +585,17 @@ func (s *GoesTestSuite) TestIndexStatus(c *C) { expectedShards := Shard{Total: 2, Successful: 1, Failed: 0} c.Assert(response.Shards, Equals, expectedShards) + primarySizeInBytes := response.Indices[indexName].Index["primary_size_in_bytes"].(float64) + sizeInBytes := response.Indices[indexName].Index["size_in_bytes"].(float64) + + c.Assert(primarySizeInBytes > 0, Equals, true) + c.Assert(sizeInBytes > 0, Equals, true) + expectedIndices := map[string]IndexStatus{ indexName: IndexStatus{ Index: map[string]interface{}{ - "primary_size_in_bytes": float64(99), - "size_in_bytes": float64(99), + "primary_size_in_bytes": primarySizeInBytes, + "size_in_bytes": sizeInBytes, }, Translog: map[string]uint64{ "operations": 0,