Skip to content

Commit

Permalink
Use dedicated index for drawing functional tests. Modifying existing …
Browse files Browse the repository at this point in the history
…test index data effects other unrelated tests
  • Loading branch information
Aaron Caldwell committed Jun 24, 2021
1 parent 0dd4265 commit 8ecec69
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 12 deletions.
6 changes: 3 additions & 3 deletions x-pack/test/api_integration/apis/maps/delete_feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function ({ getService }) {
.delete(`/api/maps/feature/999`)
.set('kbn-xsrf', 'kibana')
.send({
index: 'geo_shapes',
index: 'drawing_data',
})
.expect(200);
});
Expand All @@ -24,7 +24,7 @@ export default function ({ getService }) {
.delete(`/api/maps/feature/999`)
.set('kbn-xsrf', 'kibana')
.send({
index: 'geo_shapes',
index: 'drawing_data',
})
.expect(404);
});
Expand All @@ -34,7 +34,7 @@ export default function ({ getService }) {
.delete(`/api/maps/feature/998`)
.set('kbn-xsrf', 'kibana')
.send({
index: 'geo_shapes',
index: 'drawing_data',
})
.expect(404);
});
Expand Down
9 changes: 2 additions & 7 deletions x-pack/test/functional/apps/maps/joins.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const EXPECTED_JOIN_VALUES = {
bravo: 3,
charlie: 12,
tango: undefined,
zulu: undefined,
};

const VECTOR_SOURCE_ID = 'n1t6f';
Expand Down Expand Up @@ -77,10 +76,10 @@ export default function ({ getPageObjects, getService }) {

it('should decorate feature properties with join property', async () => {
const mapboxStyle = await PageObjects.maps.getMapboxStyle();
expect(mapboxStyle.sources[VECTOR_SOURCE_ID].data.features.length).to.equal(10);
expect(mapboxStyle.sources[VECTOR_SOURCE_ID].data.features.length).to.equal(8);

mapboxStyle.sources.n1t6f.data.features.forEach(({ properties }) => {
if (properties.name === 'tango' || properties.name === 'zulu') {
if (properties.name === 'tango') {
//left join, which means we won't rescale joins that do not match
expect(properties.hasOwnProperty(JOIN_PROPERTY_NAME)).to.be(false);
} else {
Expand All @@ -99,14 +98,12 @@ export default function ({ getPageObjects, getService }) {
});

expect(visibilitiesOfFeatures).to.eql([
false,
false,
true,
true,
true,
// geo centroids for above features
false,
false,
true,
true,
true,
Expand Down Expand Up @@ -167,14 +164,12 @@ export default function ({ getPageObjects, getService }) {
});

expect(visibilitiesOfFeatures).to.eql([
false,
false,
true,
false,
false,
// geo centroids for above features
false,
false,
true,
false,
false,
Expand Down
5 changes: 3 additions & 2 deletions x-pack/test/functional/es_archives/maps/data/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,12 @@
}
}


{
"type": "doc",
"value": {
"id": "999",
"index": "geo_shapes",
"index": "drawing_data",
"source": {
"geometry": {
"coordinates": [
Expand All @@ -165,7 +166,7 @@
],
"type": "polygon"
},
"name": "zulu",
"name": "doc-to-delete",
"prop1": 9
}
}
Expand Down
28 changes: 28 additions & 0 deletions x-pack/test/functional/es_archives/maps/data/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,34 @@
}
}

{
"type": "index",
"value": {
"index": "drawing_data",
"mappings": {
"properties": {
"geometry": {
"type": "geo_shape"
},
"name": {
"type": "keyword"
},
"prop1": {
"type": "byte"
}
}
},
"settings": {
"index": {
"number_of_replicas": "0",
"number_of_shards": "1",
"max_result_window": "10001",
"max_inner_result_window": "101"
}
}
}
}

{
"type": "index",
"value": {
Expand Down

0 comments on commit 8ecec69

Please sign in to comment.