Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Index Management functional and API integration tests robust against side effects introduced by Ingest Manager. #70533

Merged

Conversation

cjcenizal
Copy link
Contributor

@cjcenizal cjcenizal commented Jul 1, 2020

Fixes #70532

Addresses failures that were occurring in CI due to entities created by Ingest Manager:

image

…inst side effects introduced by Ingest Manager.
@cjcenizal cjcenizal added chore Feature:Index Management Index and index templates UI v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes v7.9.0 labels Jul 1, 2020
@cjcenizal cjcenizal requested review from spalger and sebelga July 1, 2020 23:09
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but would you mind reverting 0f418bb in this PR and running against the latest snapshots (instructions)

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those failures are the ones tracked by #70535, LGTM!

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Although as I commented I would even remove the functional test that could potentially break in the future and does not bring more confidence that our component integration tests provide.

expect(componentTemplateEmptyPrompt).to.be(true);
// Verify content. Component templates may have been created by other apps, e.g. Ingest Manager,
// so we don't make any assertion about the presence or absence of component templates.
const componentTemplateList = await testSubjects.exists('componentTemplateList');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no components are created automatically then this test would fail, right? I am not sure that we need this test, as this use case is covered by our component integration tests (mocked empty list = empty prompt, results = template list).

@cjcenizal cjcenizal merged commit 59ece79 into elastic:master Jul 2, 2020
@cjcenizal cjcenizal deleted the bug/index-management-functional-tests branch July 2, 2020 15:24
@cjcenizal
Copy link
Contributor Author

Thanks @sebelga! The entire content area has that data test subject selector applied to it, so it will pass even if the list is empty and displays an empty prompt (or if it's showing the loading state or if there's an error with the request). I agree with you that it might not add any value beyond our component integration tests but I'd like to uncouple that change from the other changes in this PR. @cuff-links I'd like to hear your thoughts on this at some point.

@cjcenizal
Copy link
Contributor Author

@sebelga Actually you're right, I overlooked the fact that the empty state will return early, so the selector isn't present. I'm going to fix this in another PR.

@kibanamachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / kibana-xpack-agent / X-Pack Endpoint API Integration Without Ingest Tests.x-pack/test/endpoint_api_integration_no_ingest/apis/metadata·ts.Endpoint plugin test metadata api when ingest manager is not initialized "before all" hook for "metadata api should not return results"

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:00:00]         └-: Endpoint plugin
[00:00:00]           └-> "before all" hook
[00:00:00]           └-: test metadata api when ingest manager is not initialized
[00:00:00]             └-> "before all" hook
[00:00:00]             └-> "before all" hook
[00:00:00]               │ info [endpoint/metadata/api_feature] Loading "data.json"
[00:00:00]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593703498332428848] [.ds-metrics-endpoint.metadata-default-000001] creating index, cause [initialize_data_stream], templates [metrics], shards [1]/[1]
[00:00:00]               │ info [o.e.c.m.MetadataCreateDataStreamService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593703498332428848] adding data stream [metrics-endpoint.metadata-default]
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xl-1593703498332428848] moving index [.ds-metrics-endpoint.metadata-default-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [metrics]
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xl-1593703498332428848] moving index [.ds-metrics-endpoint.metadata-default-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] in policy [metrics]
[00:00:00]               └- ✖ fail: "Endpoint plugin test metadata api when ingest manager is not initialized "before all" hook for "metadata api should not return results""
[00:00:00]               │

Stack Trace

{ Error: [illegal_argument_exception] The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead.
    at respond (/dev/shm/workspace/kibana/node_modules/elasticsearch/src/lib/transport.js:349:15)
    at checkRespForFailure (/dev/shm/workspace/kibana/node_modules/elasticsearch/src/lib/transport.js:306:7)
    at HttpConnector.<anonymous> (/dev/shm/workspace/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
    at IncomingMessage.wrapper (/dev/shm/workspace/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  status: 400,
  displayName: 'BadRequest',
  message:
   '[illegal_argument_exception] The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead.',
  path: '/_bulk',
  query: {},
  body:
   { error:
      { root_cause: [Array],
        type: 'illegal_argument_exception',
        reason:
         'The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead.' },
     status: 400 },
  statusCode: 400,
  response:
   '{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead."}],"type":"illegal_argument_exception","reason":"The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead."},"status":400}',
  toString: [Function],
  toJSON: [Function] }

Kibana Pipeline / kibana-xpack-agent / X-Pack Endpoint API Integration Without Ingest Tests.x-pack/test/endpoint_api_integration_no_ingest/apis/metadata·ts.Endpoint plugin test metadata api when ingest manager is not initialized "before all" hook for "metadata api should not return results"

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://dryrun

[00:00:00]       │
[00:00:00]         └-: Endpoint plugin
[00:00:00]           └-> "before all" hook
[00:00:00]           └-: test metadata api when ingest manager is not initialized
[00:00:00]             └-> "before all" hook
[00:00:00]             └-> "before all" hook
[00:00:00]               │ info [endpoint/metadata/api_feature] Loading "data.json"
[00:00:00]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593703498332428848] [.ds-metrics-endpoint.metadata-default-000001] creating index, cause [initialize_data_stream], templates [metrics], shards [1]/[1]
[00:00:00]               │ info [o.e.c.m.MetadataCreateDataStreamService] [kibana-ci-immutable-ubuntu-18-tests-xl-1593703498332428848] adding data stream [metrics-endpoint.metadata-default]
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xl-1593703498332428848] moving index [.ds-metrics-endpoint.metadata-default-000001] from [null] to [{"phase":"new","action":"complete","name":"complete"}] in policy [metrics]
[00:00:00]               │ info [o.e.x.i.IndexLifecycleTransition] [kibana-ci-immutable-ubuntu-18-tests-xl-1593703498332428848] moving index [.ds-metrics-endpoint.metadata-default-000001] from [{"phase":"new","action":"complete","name":"complete"}] to [{"phase":"hot","action":"unfollow","name":"wait-for-indexing-complete"}] in policy [metrics]
[00:00:00]               └- ✖ fail: "Endpoint plugin test metadata api when ingest manager is not initialized "before all" hook for "metadata api should not return results""
[00:00:00]               │

Stack Trace

{ Error: [illegal_argument_exception] The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead.
    at respond (/dev/shm/workspace/kibana/node_modules/elasticsearch/src/lib/transport.js:349:15)
    at checkRespForFailure (/dev/shm/workspace/kibana/node_modules/elasticsearch/src/lib/transport.js:306:7)
    at HttpConnector.<anonymous> (/dev/shm/workspace/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)
    at IncomingMessage.wrapper (/dev/shm/workspace/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  status: 400,
  displayName: 'BadRequest',
  message:
   '[illegal_argument_exception] The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead.',
  path: '/_bulk',
  query: {},
  body:
   { error:
      { root_cause: [Array],
        type: 'illegal_argument_exception',
        reason:
         'The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead.' },
     status: 400 },
  statusCode: 400,
  response:
   '{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead."}],"type":"illegal_argument_exception","reason":"The provided expression [metrics-endpoint.metadata-default] matches a data stream, specify the corresponding concrete indices instead."},"status":400}',
  toString: [Function],
  toJSON: [Function] }

Kibana Pipeline / x-pack-intake-agent / X-Pack Jest Tests.x-pack/plugins/security_solution/public/timelines/store/timeline.epicLocalStorage persist adding / reordering of a column correctly

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(jest.fn()).toHaveBeenCalled()

Expected number of calls: >= 1
Received number of calls:    0
    at Object.it (/dev/shm/workspace/kibana/x-pack/plugins/security_solution/public/timelines/store/timeline/epic_local_storage.test.tsx:126:38)

Build metrics

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cjcenizal added a commit that referenced this pull request Jul 3, 2020
…st against side effects introduced by Ingest Manager. (#70533) (#70612)

* Make Index Management functional and API integration tests robust against side effects introduced by Ingest Manager. (#70533)

* Update component templates list to render empty prompt inside of content container. Show detail panel when deep-linked, even if there are no component templates. (#70633)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:Index Management Index and index templates UI release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ES Snapshots Failure] Index management - Component templates
5 participants