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

[ML] Transforms: Add functional tests for UI permissions #106693

Merged

Conversation

peteharverson
Copy link
Contributor

@peteharverson peteharverson commented Jul 26, 2021

Summary

Adds functional tests for UI permissions on the Transforms page under Stack Management.

Checks permissions on the Transforms management page and edit transform flyout for the following users:

  • TRANSFORM_POWERUSER
  • TRANSFORM_VIEWER

High-level tests

For more details see test step descriptions.

With no data loaded

  • Displays elements on the Transforms list page correctly
  • Displays enabled / disabled Create first transform button

With data loaded

  • Displays elements on the Transforms list page correctly
  • Displays enabled / disabled Create new transform button
  • Displays created transform
  • Displays enabled / disabled actions menu
  • Displays controls in the edit transform correctly (for TRANSFORM_POWERUSER)

Part of #106113.

Checklist

@peteharverson peteharverson self-assigned this Jul 26, 2021
@peteharverson peteharverson requested a review from a team as a code owner July 26, 2021 10:02
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@pheyos
Copy link
Member

pheyos commented Jul 26, 2021

Checking test stability in a flaky test runner job ... 50 failures in 50 runs ❌
Looks like the action popover wasn't open so the Edit button couldn't be clicked. Not sure why it passed locally for me though 🤔

@pheyos
Copy link
Member

pheyos commented Jul 26, 2021

Checking test stability after the change in a flaky test runner job ... 28 transform failures in 50 runs ❌

All the failures are about action menu entries not being available due to a closed actions popover, but no failure for the permission tests anymore. Looks like we need to apply the fix (use clickTransformRowActionWithRetry instead of clickTransformRowAction) to all place where the transform actions are used.

@pheyos
Copy link
Member

pheyos commented Jul 27, 2021

Checking test stability after the latest changes in a flaky test runner job ... no failure in 50 runs ✔️

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / X-Pack Spaces API Integration Tests -- security_and_spaces.x-pack/test/spaces_api_integration/security_and_spaces/apis/get_all·ts.spaces api with security get all dual-privileges readonly user can access all spaces from space_1 "before all" hook in "dual-privileges readonly user can access all spaces from space_1"

Link to Jenkins

Standard Out

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

[00:00:00]       │
[00:00:00]         └-: spaces api with security
[00:00:00]           └-> "before all" hook in "spaces api with security"
[00:00:00]           └-> "before all" hook in "spaces api with security"
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_legacy_user]
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_dual_privileges_user]
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_dual_privileges_dashboard_only_user]
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_user]
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_dashboard_only_user]
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_default_space_all_user]
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_default_space_read_user]
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_space_1_all_user]
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_space_1_read_user]
[00:00:00]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_space_2_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_space_2_read_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_space_1_2_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_space_1_2_read_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_default_space_saved_objects_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_default_space_saved_objects_read_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_space_1_saved_objects_all_user]
[00:00:01]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [kibana_rbac_space_1_saved_objects_read_user]
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [not_a_kibana_user]
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_legacy_user]
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_dual_privileges_user]
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_dual_privileges_dashboard_only_user]
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_user]
[00:00:01]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_dashboard_only_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_default_space_all_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_default_space_read_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_space_1_all_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_space_1_read_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_space_2_all_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_space_2_read_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_space_1_2_all_user]
[00:00:02]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_space_1_2_read_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_default_space_saved_objects_all_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_default_space_saved_objects_read_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_space_1_saved_objects_all_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_kibana_rbac_space_1_saved_objects_read_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_apm_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_machine_learning_admin]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_machine_learning_user]
[00:00:03]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [a_monitoring_user]
[00:04:33]           └-: get all
[00:04:33]             └-> "before all" hook in "get all"
[00:04:52]             └-: dual-privileges readonly user can access all spaces from space_1
[00:04:52]               └-> "before all" hook in "dual-privileges readonly user can access all spaces from space_1"
[00:04:52]               └-> "before all" hook in "dual-privileges readonly user can access all spaces from space_1"
[00:04:52]                 │ info [x-pack/test/spaces_api_integration/common/fixtures/es_archiver/saved_objects/spaces] Loading "mappings.json"
[00:04:52]                 │ info [x-pack/test/spaces_api_integration/common/fixtures/es_archiver/saved_objects/spaces] Loading "data.json"
[00:04:52]                 │ info [o.e.c.m.MetadataDeleteIndexService] [node-01] [.kibana_8.0.0_001/CSdqgMwuQzuN00FiFHLT8w] deleting index
[00:04:52]                 │ info [o.e.c.m.MetadataDeleteIndexService] [node-01] [.kibana_task_manager_8.0.0_001/SM12tgasQdCaA43i3dogkQ] deleting index
[00:04:52]                 │ info [x-pack/test/spaces_api_integration/common/fixtures/es_archiver/saved_objects/spaces] Deleted existing index ".kibana_8.0.0_001"
[00:04:52]                 │ info [x-pack/test/spaces_api_integration/common/fixtures/es_archiver/saved_objects/spaces] Deleted existing index ".kibana_task_manager_8.0.0_001"
[00:04:52]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [.kibana_8.0.0] creating index, cause [auto(update api)], templates [], shards [1]/[1]
[00:04:52]                 └- ✖ fail: spaces api with security get all dual-privileges readonly user can access all spaces from space_1 "before all" hook in "dual-privileges readonly user can access all spaces from space_1"
[00:04:52]                 │       ResponseError: invalid_alias_name_exception: [invalid_alias_name_exception] Reason: Invalid alias name [.kibana_8.0.0]: an index or data streamexists with the same name as the alias
[00:04:52]                 │       at onBody (/dev/shm/workspace/parallel/20/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
[00:04:52]                 │       at IncomingMessage.onEnd (/dev/shm/workspace/parallel/20/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
[00:04:52]                 │       at endReadableNT (internal/streams/readable.js:1317:12)
[00:04:52]                 │       at processTicksAndRejections (internal/process/task_queues.js:82:21)
[00:04:52]                 │ 
[00:04:52]                 │ 

Stack Trace

ResponseError: invalid_alias_name_exception: [invalid_alias_name_exception] Reason: Invalid alias name [.kibana_8.0.0]: an index or data stream exists with the same name as the alias
    at onBody (/dev/shm/workspace/parallel/20/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
    at IncomingMessage.onEnd (/dev/shm/workspace/parallel/20/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
    at endReadableNT (internal/streams/readable.js:1317:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  meta: {
    body: { error: [Object], status: 400 },
    statusCode: 400,
    headers: {
      'x-elastic-product': 'Elasticsearch',
      'content-type': 'application/json;charset=utf-8',
      'content-length': '337'
    },
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 0,
      aborted: false
    }
  }
}

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
transform 924.2KB 924.4KB +244.0B

History

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

cc @peteharverson

@qn895
Copy link
Member

qn895 commented Jul 27, 2021

LGTM 🎉

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

LGTM

@peteharverson peteharverson added the auto-backport Deprecated - use backport:version if exact versions are needed label Jul 28, 2021
@peteharverson peteharverson merged commit f67737d into elastic:master Jul 28, 2021
@peteharverson peteharverson deleted the transforms-permissions-func-tests branch July 28, 2021 08:25
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 28, 2021
)

* [ML] Transforms: Add functional tests for UI permissions

* [ML] Fix for edit flyout action

* [ML] Stabilize tests that open the actions menu
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jul 28, 2021
…106960)

* [ML] Transforms: Add functional tests for UI permissions

* [ML] Fix for edit flyout action

* [ML] Stabilize tests that open the actions menu

Co-authored-by: Pete Harverson <peteharverson@users.noreply.github.com>
streamich pushed a commit to vadimkibana/kibana that referenced this pull request Aug 8, 2021
)

* [ML] Transforms: Add functional tests for UI permissions

* [ML] Fix for edit flyout action

* [ML] Stabilize tests that open the actions menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Transforms ML transforms :ml release_note:skip Skip the PR/issue when compiling release notes review test_ui_functional v7.15.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants