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

[Lens] Fix runtime mappings by using new API #83350

Closed
wants to merge 6 commits into from

Conversation

wylieconlon
Copy link
Contributor

@wylieconlon wylieconlon commented Nov 12, 2020

Instead of removing this code, we can use the new API that was introduced here: elastic/elasticsearch#62906

Another option is to remove the runtime fields entirely, but it appears that we have usage in both Lens and the Security solution.

@wylieconlon wylieconlon added Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Lens v7.11.0 labels Nov 12, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293
Copy link
Contributor

@elasticmachine merge upstream

@flash1293
Copy link
Contributor

@wylieconlon
Copy link
Contributor Author

@flash1293 This PR is being tested against a snapshot that isn't available on master, it needs that one-line change to the Jenkinsfile to test the right thing. Will remove before merging.

@apmmachine
Copy link
Contributor

💚 Build Succeeded

@wylieconlon wylieconlon changed the title [Lens] Remove runtime fields from tests [Lens] Fix runtime mappings by using new API Nov 16, 2020
"script" : { "source" : "emit(doc['bytes'].value)" }
"type": "long",
"script": {
"script": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these be double nested?

@kibanamachine
Copy link
Contributor

kibanamachine commented Nov 17, 2020

💔 Build Failed

Failed CI Steps


Test Failures

X-Pack API Integration Tests (Security Basic).x-pack/test/api_integration/apis/security/index_fields·ts.security (basic license) Index Fields GET /internal/security/fields/{query} should not include runtime fields

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:00]         └-: security (basic license)
[00:00:00]           └-> "before all" hook
[00:00:16]           └-: Index Fields
[00:00:16]             └-> "before all" hook
[00:00:16]             └-> "before all" hook
[00:00:16]               │ info [security/flstest/data] Loading "mappings.json"
[00:00:16]               │ info [security/flstest/data] Loading "data.json.gz"
[00:00:16]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1605631580506800623] [flstest] creating index, cause [api], templates [], shards [5]/[1]
[00:00:16]               │ info [security/flstest/data] Created index "flstest"
[00:00:16]               │ debg [security/flstest/data] "flstest" settings {"index":{"number_of_replicas":"1","number_of_shards":"5"}}
[00:00:16]               │ info [security/flstest/data] Indexed 2 docs into "flstest"
[00:00:16]             └-: GET /internal/security/fields/{query}
[00:00:16]               └-> "before all" hook
[00:00:16]               └-> should return a list of available index mapping fields
[00:00:16]                 └-> "before each" hook: global before each
[00:00:16]                 └- ✓ pass  (51ms) "security (basic license) Index Fields GET /internal/security/fields/{query} should return a list of available index mapping fields"
[00:00:16]               └-> should not include runtime fields
[00:00:16]                 └-> "before each" hook: global before each
[00:00:16]                 └- ✖ fail: security (basic license) Index Fields GET /internal/security/fields/{query} should not include runtime fields
[00:00:16]                 │      Error: expected [ '_routing',
[00:00:16]                 │   'customer_name.keyword',
[00:00:16]                 │   '_doc_count',
[00:00:16]                 │   'customer_ssn',
[00:00:16]                 │   '_index',
[00:00:16]                 │   '_feature',
[00:00:16]                 │   'customer_region',
[00:00:16]                 │   '_ignored',
[00:00:16]                 │   '_seq_no',
[00:00:16]                 │   'customer_region.keyword',
[00:00:16]                 │   '_nested_path',
[00:00:16]                 │   '_data_stream_timestamp',
[00:00:16]                 │   '_field_names',
[00:00:16]                 │   '_source',
[00:00:16]                 │   '_id',
[00:00:16]                 │   'customer_name',
[00:00:16]                 │   'customer_ssn.keyword',
[00:00:16]                 │   '_version' ] to contain 'runtime_customer_ssn'
[00:00:16]                 │       at Assertion.assert (/dev/shm/workspace/parallel/3/kibana/packages/kbn-expect/expect.js:100:11)
[00:00:16]                 │       at Assertion.contain (/dev/shm/workspace/parallel/3/kibana/packages/kbn-expect/expect.js:447:10)
[00:00:16]                 │       at Context.<anonymous> (test/api_integration/apis/security/index_fields.ts:65:63)
[00:00:16]                 │       at processTicksAndRejections (internal/process/task_queues.js:97:5)
[00:00:16]                 │       at Object.apply (/dev/shm/workspace/parallel/3/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)
[00:00:16]                 │ 
[00:00:16]                 │ 

Stack Trace

Error: expected [ '_routing',
  'customer_name.keyword',
  '_doc_count',
  'customer_ssn',
  '_index',
  '_feature',
  'customer_region',
  '_ignored',
  '_seq_no',
  'customer_region.keyword',
  '_nested_path',
  '_data_stream_timestamp',
  '_field_names',
  '_source',
  '_id',
  'customer_name',
  'customer_ssn.keyword',
  '_version' ] to contain 'runtime_customer_ssn'
    at Assertion.assert (/dev/shm/workspace/parallel/3/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.contain (/dev/shm/workspace/parallel/3/kibana/packages/kbn-expect/expect.js:447:10)
    at Context.<anonymous> (test/api_integration/apis/security/index_fields.ts:65:63)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Object.apply (/dev/shm/workspace/parallel/3/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)

X-Pack API Integration Tests (Security Basic).x-pack/test/api_integration/apis/security/index_fields·ts.security (basic license) Index Fields GET /internal/security/fields/{query} should not include runtime fields

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:00]         └-: security (basic license)
[00:00:00]           └-> "before all" hook
[00:00:16]           └-: Index Fields
[00:00:16]             └-> "before all" hook
[00:00:16]             └-> "before all" hook
[00:00:16]               │ info [security/flstest/data] Loading "mappings.json"
[00:00:16]               │ info [security/flstest/data] Loading "data.json.gz"
[00:00:16]               │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1605631580506800623] [flstest] creating index, cause [api], templates [], shards [5]/[1]
[00:00:16]               │ info [security/flstest/data] Created index "flstest"
[00:00:16]               │ debg [security/flstest/data] "flstest" settings {"index":{"number_of_replicas":"1","number_of_shards":"5"}}
[00:00:16]               │ info [security/flstest/data] Indexed 2 docs into "flstest"
[00:00:16]             └-: GET /internal/security/fields/{query}
[00:00:16]               └-> "before all" hook
[00:00:16]               └-> should return a list of available index mapping fields
[00:00:16]                 └-> "before each" hook: global before each
[00:00:16]                 └- ✓ pass  (48ms) "security (basic license) Index Fields GET /internal/security/fields/{query} should return a list of available index mapping fields"
[00:00:16]               └-> should not include runtime fields
[00:00:16]                 └-> "before each" hook: global before each
[00:00:16]                 └- ✖ fail: security (basic license) Index Fields GET /internal/security/fields/{query} should not include runtime fields
[00:00:16]                 │      Error: expected [ '_routing',
[00:00:16]                 │   'customer_name.keyword',
[00:00:16]                 │   '_doc_count',
[00:00:16]                 │   'customer_ssn',
[00:00:16]                 │   '_index',
[00:00:16]                 │   '_feature',
[00:00:16]                 │   'customer_region',
[00:00:16]                 │   '_ignored',
[00:00:16]                 │   '_seq_no',
[00:00:16]                 │   'customer_region.keyword',
[00:00:16]                 │   '_nested_path',
[00:00:16]                 │   '_data_stream_timestamp',
[00:00:16]                 │   '_field_names',
[00:00:16]                 │   '_source',
[00:00:16]                 │   '_id',
[00:00:16]                 │   'customer_name',
[00:00:16]                 │   'customer_ssn.keyword',
[00:00:16]                 │   '_version' ] to contain 'runtime_customer_ssn'
[00:00:16]                 │       at Assertion.assert (/dev/shm/workspace/parallel/3/kibana/packages/kbn-expect/expect.js:100:11)
[00:00:16]                 │       at Assertion.contain (/dev/shm/workspace/parallel/3/kibana/packages/kbn-expect/expect.js:447:10)
[00:00:16]                 │       at Context.<anonymous> (test/api_integration/apis/security/index_fields.ts:65:63)
[00:00:16]                 │       at processTicksAndRejections (internal/process/task_queues.js:97:5)
[00:00:16]                 │       at Object.apply (/dev/shm/workspace/parallel/3/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)
[00:00:16]                 │ 
[00:00:16]                 │ 

Stack Trace

Error: expected [ '_routing',
  'customer_name.keyword',
  '_doc_count',
  'customer_ssn',
  '_index',
  '_feature',
  'customer_region',
  '_ignored',
  '_seq_no',
  'customer_region.keyword',
  '_nested_path',
  '_data_stream_timestamp',
  '_field_names',
  '_source',
  '_id',
  'customer_name',
  'customer_ssn.keyword',
  '_version' ] to contain 'runtime_customer_ssn'
    at Assertion.assert (/dev/shm/workspace/parallel/3/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.contain (/dev/shm/workspace/parallel/3/kibana/packages/kbn-expect/expect.js:447:10)
    at Context.<anonymous> (test/api_integration/apis/security/index_fields.ts:65:63)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Object.apply (/dev/shm/workspace/parallel/3/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:84:16)

Metrics [docs]

✅ unchanged

History

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

@wylieconlon
Copy link
Contributor Author

Fixed in #83530

@wylieconlon wylieconlon deleted the fix-runtime-fields branch November 17, 2020 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants