Skip to content

Commit

Permalink
Fix test for 5.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
charlotth committed Feb 14, 2018
1 parent 7767e79 commit 034a65f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 34 deletions.
11 changes: 5 additions & 6 deletions build.sh
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

source test_package.sh

rm -Rf releases
mkdir -p releases

Expand All @@ -10,6 +12,8 @@ function build {
new=$(echo $old | sed -E "s/(^build)(\/datasweet_formula-.+)\.zip$/releases\2_kibana-$1.zip/")
mv -v "$old" "$new"
done

test $1
}

build 6.2.1
Expand All @@ -30,9 +34,4 @@ build 5.6.4
build 5.6.3
build 5.6.2
build 5.6.1
build 5.6.0

build 5.5.3
build 5.5.2
build 5.5.1
build 5.5.0
build 5.6.0
34 changes: 6 additions & 28 deletions test.sh → test_package.sh
Expand Up @@ -57,7 +57,12 @@ function test {
curl -H 'Content-Type: application/json' -H 'kbn-name: kibana' -H "kbn-version: $1" -XPOST 'localhost:5601/api/kibana/settings/defaultIndex' --data `printf '{"value":"%s"}' $IPID`
curl -H 'Content-Type: application/json' -H 'kbn-name: kibana' -H "kbn-version: $1" -XPUT "localhost:5601/api/saved_objects/index-pattern/$IPID" --data-binary @tests/index-pattern-2.json

VIZ=$(cat tests/viz.json)
if [[ $1 =~ ^5* ]]; then
VIZ=$(cat tests/viz-5x.json)
elif [[ $1 =~ ^6* ]]; then
VIZ=$(cat tests/viz-6x.json)
fi

VIZ=`echo ${VIZ/formula-index-pattern/$IPID}`
VIZ=`echo ${VIZ//formula-kbn-version/v$1}`
IDVIZ=`curl -H 'Content-Type: application/json' -H 'kbn-name: kibana' -H "kbn-version: $1" -XPOST 'localhost:5601/api/saved_objects/visualization?overwrite=true' --data "$VIZ" | jq .id | tr -d '"'`
Expand All @@ -68,32 +73,5 @@ function test {
screencapture -x releases/datasweet_formula-${PACKAGE_VERSION}_kibana-$1.jpg
}


test 6.2.1
test 6.2.0

test 6.1.3
test 6.1.2
test 6.1.1
test 6.1.0

test 6.0.1
test 6.0.0

test 5.6.7
test 5.6.6
test 5.6.5
test 5.6.4
test 5.6.3
test 5.6.2
test 5.6.1
test 5.6.0

test 5.5.3
test 5.5.2
test 5.5.1
test 5.5.0

# test $1
stop
echo "Done !\n"
12 changes: 12 additions & 0 deletions tests/viz-5x.json
@@ -0,0 +1,12 @@
{
"attributes": {
"title": "formula-kbn-version",
"visState": "{\"title\":\"formula-kbn-version\",\"type\":\"line\",\"params\":{\"addLegend\":true,\"addTimeMarker\":false,\"addTooltip\":true,\"categoryAxes\":[{\"id\":\"CategoryAxis-1\",\"labels\":{\"show\":true,\"truncate\":100},\"position\":\"bottom\",\"scale\":{\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{},\"type\":\"category\"}],\"grid\":{\"categoryLines\":false,\"style\":{\"color\":\"#eee\"}},\"legendPosition\":\"right\",\"seriesParams\":[{\"data\":{\"id\":\"1\",\"label\":\"Sum of speech_number\"},\"drawLinesBetweenPoints\":true,\"mode\":\"normal\",\"show\":\"true\",\"showCircles\":true,\"type\":\"line\",\"valueAxis\":\"ValueAxis-1\"},{\"data\":{\"id\":\"3\",\"label\":\"Count\"},\"drawLinesBetweenPoints\":true,\"mode\":\"normal\",\"show\":true,\"showCircles\":true,\"type\":\"line\",\"valueAxis\":\"ValueAxis-1\"},{\"data\":{\"id\":\"4\",\"label\":\"Rate\"},\"drawLinesBetweenPoints\":true,\"mode\":\"normal\",\"show\":true,\"showCircles\":true,\"type\":\"area\",\"valueAxis\":\"ValueAxis-1\"},{\"show\":true,\"mode\":\"normal\",\"type\":\"line\",\"drawLinesBetweenPoints\":true,\"showCircles\":true,\"interpolate\":\"linear\",\"data\":{\"id\":\"5\",\"label\":\"Formula 5\"},\"valueAxis\":\"ValueAxis-2\"}],\"times\":[],\"type\":\"line\",\"valueAxes\":[{\"id\":\"ValueAxis-1\",\"labels\":{\"filter\":false,\"rotate\":0,\"show\":true,\"truncate\":100},\"name\":\"LeftAxis-1\",\"position\":\"left\",\"scale\":{\"mode\":\"normal\",\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{\"text\":\"Sum of speech_number\"},\"type\":\"value\"},{\"id\":\"ValueAxis-2\",\"labels\":{\"filter\":false,\"rotate\":0,\"show\":true,\"truncate\":100},\"name\":\"RightAxis-1\",\"position\":\"right\",\"scale\":{\"mode\":\"normal\",\"type\":\"linear\"},\"show\":true,\"style\":{},\"title\":{\"text\":\"Formula 5\"},\"type\":\"value\"}]},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"sum\",\"schema\":\"metric\",\"params\":{\"field\":\"speech_number\"},\"hidden\":true},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"speaker\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"size\":20,\"order\":\"asc\",\"orderBy\":\"_term\"},\"hidden\":false},{\"id\":\"3\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{},\"hidden\":true},{\"id\":\"4\",\"enabled\":true,\"type\":\"datasweet_formula\",\"schema\":\"metric\",\"params\":{\"formula\":\"agg1 / agg3\",\"formatter\":\"percent\",\"customLabel\":\"Rate\"},\"hidden\":false},{\"id\":\"5\",\"enabled\":true,\"type\":\"datasweet_formula\",\"schema\":\"metric\",\"params\":{\"formula\":\"cusum(agg4)\",\"formatter\":\"number\"},\"hidden\":false}]}",
"uiStateJSON": "{\"vis\":{\"colors\":{\"Rate\":\"#E24D42\",\"Formula 5\":\"#9AC48A\"}}}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"formula-index-pattern\",\"filter\":[],\"query\":{\"match_all\":{}}}"
}
}
}
File renamed without changes.

0 comments on commit 034a65f

Please sign in to comment.