Skip to content

Commit

Permalink
[FTR - esArchiver] Update delete_unknown_types archive to NOT delet…
Browse files Browse the repository at this point in the history
…e SO indices (#161936)

## Summary

Part of #161882

Updates the
`test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types`
archive:
* deleting `mappings.json`
* updating documents in `data.json`

This way, _esArchiver_ will not delete SO indices and recreate them,
eliminating the odds of the related tests being flaky.
  • Loading branch information
gsoldevila authored Jul 17, 2023
1 parent 94a495f commit 7cee234
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1,330 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export default function ({ getService }: FtrProviderContext) {

describe('/deprecations/_delete_unknown_types', () => {
before(async () => {
await esArchiver.emptyKibanaIndex();
// we are injecting unknown types in this test, so we need to relax the mappings restrictions
await es.indices.putMapping({ index: '.kibana', dynamic: true });
await esArchiver.load(
'test/api_integration/fixtures/es_archiver/saved_objects/delete_unknown_types'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
"id": "index-pattern:8963ca30-3224-11e8-a572-ffca06da1357",
"index": ".kibana_analytics",
"source": {
"coreMigrationVersion": "7.14.0",
"coreMigrationVersion": "8.8.0",
"index-pattern": {
"fields": "[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"id\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true}]",
"title": "saved_objects*"
},
"migrationVersion": {
"index-pattern": "7.11.0"
},
"references": [
],
"references": [],
"type": "index-pattern",
"updated_at": "2018-03-28T01:08:34.290Z"
},
"type": "_doc"
"updated_at": "2018-03-28T01:08:34.290Z",
"namespaces": [
"default"
],
"typeMigrationVersion": "8.0.0"
}
}
}

Expand All @@ -27,10 +26,7 @@
"id": "search:960372e0-3224-11e8-a572-ffca06da1357",
"index": ".kibana_analytics",
"source": {
"coreMigrationVersion": "7.14.0",
"migrationVersion": {
"search": "7.9.3"
},
"coreMigrationVersion": "8.8.0",
"references": [
{
"id": "8963ca30-3224-11e8-a572-ffca06da1357",
Expand All @@ -57,9 +53,12 @@
"version": 1
},
"type": "search",
"updated_at": "2018-03-28T01:08:55.182Z"
},
"type": "_doc"
"updated_at": "2018-03-28T01:08:55.182Z",
"namespaces": [
"default"
],
"typeMigrationVersion": "8.0.0"
}
}
}

Expand All @@ -69,10 +68,7 @@
"id": "visualization:a42c0580-3224-11e8-a572-ffca06da1357",
"index": ".kibana_analytics",
"source": {
"coreMigrationVersion": "7.14.0",
"migrationVersion": {
"visualization": "7.14.0"
},
"coreMigrationVersion": "8.8.0",
"references": [
{
"id": "960372e0-3224-11e8-a572-ffca06da1357",
Expand All @@ -92,9 +88,12 @@
"uiStateJSON": "{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}",
"version": 1,
"visState": "{\"title\":\"VisualizationFromSavedSearch\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMeticsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\",\"showToolbar\":true},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}}]}"
}
},
"type": "_doc"
},
"namespaces": [
"default"
],
"typeMigrationVersion": "8.0.0"
}
}
}

Expand All @@ -104,7 +103,7 @@
"id": "dashboard:b70c7ae0-3224-11e8-a572-ffca06da1357",
"index": ".kibana_analytics",
"source": {
"coreMigrationVersion": "7.14.0",
"coreMigrationVersion": "8.8.0",
"dashboard": {
"description": "",
"hits": 0,
Expand All @@ -117,9 +116,6 @@
"title": "Dashboard",
"version": 1
},
"migrationVersion": {
"dashboard": "7.14.0"
},
"references": [
{
"id": "add810b0-3224-11e8-a572-ffca06da1357",
Expand All @@ -133,13 +129,15 @@
}
],
"type": "dashboard",
"updated_at": "2018-03-28T01:09:50.606Z"
},
"type": "_doc"
"updated_at": "2018-03-28T01:09:50.606Z",
"namespaces": [
"default"
],
"typeMigrationVersion": "8.0.0"
}
}
}


{
"type": "doc",
"value": {
Expand All @@ -151,16 +149,14 @@
"foo": "bar"
},
"migrationVersion": {},
"references": [
],
"references": [],
"type": "unknown-type",
"updated_at": "2018-03-28T01:08:34.290Z"
},
"type": "_doc"
}
}


{
"type": "doc",
"value": {
Expand All @@ -172,11 +168,11 @@
"foo": "bar"
},
"migrationVersion": {},
"references": [
],
"references": [],
"type": "unknown-shareable-type",
"updated_at": "2018-03-28T01:08:34.290Z"
},
"type": "_doc"
}
}

Loading

0 comments on commit 7cee234

Please sign in to comment.