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

[RAC] [Observability] Add functional tests covering the alert workflow status #111788

Merged
merged 6 commits into from
Sep 16, 2021

Conversation

weltenwort
Copy link
Member

@weltenwort weltenwort commented Sep 9, 2021

📝 Summary

This adds functional tests for the alert workflow status actions in the alerts table's row actions.

closes #110641

🕵️‍♀️ Review notes

  • I created a function that groups the table cells into rows by counting the column headers. This would probably be useful for the existing tests as well, but I didn't roll it out to avoid conflicts in the index.ts file.

@weltenwort weltenwort added v8.0.0 Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed Theme: rac label obsolete v7.16.0 labels Sep 9, 2021
@weltenwort weltenwort self-assigned this Sep 9, 2021
@weltenwort weltenwort force-pushed the rac-test-workflow-actions branch from 536674f to 5126769 Compare September 13, 2021 10:29
@weltenwort weltenwort force-pushed the rac-test-workflow-actions branch from 5126769 to b7ab54b Compare September 13, 2021 19:31
@weltenwort weltenwort marked this pull request as ready for review September 14, 2021 09:59
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@weltenwort weltenwort requested a review from a team September 14, 2021 11:13
@Kerry350 Kerry350 self-requested a review September 14, 2021 16:01
Copy link
Contributor

@miltonhultgren miltonhultgren left a comment

Choose a reason for hiding this comment

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

Looks good overall, just some questions about structure!

x-pack/test/functional/services/observability/alerts.ts Outdated Show resolved Hide resolved
await esArchiver.unload('x-pack/test/functional/es_archives/observability/alerts');
});

it('is filtered for "open" by default', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Is it more more common to say "filter by"? This confused my brain for a moment

Copy link
Member Author

Choose a reason for hiding this comment

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

In "filter by" I'm always wondering whether it means to include or exclude. But I can probably try harder to find an unambiguous description with more natural grammar.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've tried to make the test case names clearer.

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW for me, by always means include. Similar to how "sort by" works, you sort by what you desire, and you filter by what you desire. But the "predicate" nature of this makes it harder I agree.
But I would imagine it likes this: filter by $PREDICATE, where if the predicate is true you include it, so "open" vs "not open"

x-pack/test/functional/services/observability/alerts.ts Outdated Show resolved Hide resolved
@Kerry350
Copy link
Contributor

Just came to review this, but @miltonhultgren has it covered 👌

I'll unassign myself.

@Kerry350 Kerry350 removed their request for review September 15, 2021 13:34
Copy link
Contributor

@miltonhultgren miltonhultgren left a comment

Choose a reason for hiding this comment

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

LGTM!

Left some more nit picky questions but nothing that needs changing.


const ACTION_COLUMN_INDEX = 1;

type WorkflowStatus = 'open' | 'acknowledged' | 'closed';
Copy link
Contributor

Choose a reason for hiding this comment

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

Just out of curiosity, what is the risk of pulling this from the production code base?
Is it more from the perspective of blackbox testing or risk of coupling the code bases from a tooling perspective?

Copy link
Member Author

@weltenwort weltenwort Sep 16, 2021

Choose a reason for hiding this comment

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

The tooling can be problematic as well (TS performance in the test directories is terrible already), but the former point weighs heavier for me. These tests are supposed to be from the user's perspective and would therefore be aligned more with the UI concepts than the technical concepts. One example for that "looks the same, but actually isn't" is the fact that I needed to address the menu item via the verb "close" rather than the state "closed". So there is a correspondence between action and state, but they are not identical.

});
});

it('can be set to "acknowledged" using the row menu', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Similar here, this test name is still a bit unclear with regards to what "can be set". Maybe the word alert is needed here as well?
"an alert can be set to "acknowledged" using the row action menu"?

I don't think this needs to be changed, more looking to discuss patterns.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

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
observability 550.0KB 550.0KB +54.0B

History

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

cc @weltenwort

@weltenwort weltenwort merged commit 2282d53 into elastic:master Sep 16, 2021
@weltenwort weltenwort deleted the rac-test-workflow-actions branch September 16, 2021 14:05
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 16, 2021
@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 Sep 16, 2021
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 release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services Theme: rac label obsolete v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RAC] [Observability] Create functional tests for alerts table workflow status actions and filter
5 participants