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

Re-enable and fix APM E2E tests #114831

Merged
merged 12 commits into from
Oct 15, 2021
Merged

Re-enable and fix APM E2E tests #114831

merged 12 commits into from
Oct 15, 2021

Conversation

smith
Copy link
Contributor

@smith smith commented Oct 13, 2021

  • Re-enable previously disabled APM E2E tests.
  • Round to the nearest second in getComparisonTypes to avoid cases where a millisecond difference can change which results get shown.
  • Simplify error count alert tests to test the "happy path" ([APM] E2E tests for rules & alerts #79284 exists in order to expand to more tests for rule editing and creation.)
  • Wait for alert list API request to complete before clicking "Create rule" button when running the test to create a rule from the Stack Management UI.

I ran the e2e tests 100 times locally with no failures so I'm confident the flakiness has been addressed.

Fixes #114419.
Fixes #109205.

smith added 2 commits October 13, 2021 09:57
* Run previously disabled APM E2E tests on all PRs (we were previously only running them when APM files had changes.)
* Remove `precise: true` from `getComparisonTypes` call which caused intermittent failures in date comparison tests.
* Simplify error count alert tests to test the "happy path" (elastic#79284 exists in order to expand to more tests for rule editing and creation)
* Wait for alert list API request to complete before clicking "Create rule" button when running the test to create a rule from the Stack Management UI.

I ran the e2e tests 100 times locally with no failures so I'm confident the flakiness has been addressed.

Fixes elastic#114419.
Fixes elastic#109205.
@smith smith added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v7.16.0 labels Oct 13, 2021
@smith smith requested a review from a team as a code owner October 13, 2021 15:06
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Oct 13, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@smith smith requested a review from a team as a code owner October 13, 2021 15:11
vars/tasks.groovy Outdated Show resolved Hide resolved
Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

Do we want the buildkite version updated too?

.buildkite/scripts/pipelines/pull_request/pipeline.js

@@ -20,66 +20,55 @@ describe('Rules', () => {
describe('when created from Service Inventory', () => {
before(() => {
cy.loginAsPowerUser();
cy.deleteAllRules();
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you really need to call this on before and after?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works if you don't do this, but it's better to start with a consistent state (that is, no rules present) and clean up afterwards. It's possible a previous test errors and fails to clean up after itself to this ensures that does not impact the results of this test.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

Test changes look good to me.

@smith smith requested a review from spalger October 13, 2021 15:34
@smith
Copy link
Contributor Author

smith commented Oct 13, 2021

@jbudz

Do we want the buildkite version updated too?

.buildkite/scripts/pipelines/pull_request/pipeline.js

Updated in a988be0.

@smith
Copy link
Contributor Author

smith commented Oct 13, 2021

@elasticmachine merge upstream

@@ -7,6 +7,22 @@
import 'cypress-real-events/support';
import { Interception } from 'cypress/types/net-stubbing';

Cypress.Commands.add('deleteAllRules', () => {
Copy link
Member

Choose a reason for hiding this comment

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

What about namespacing commands like:

Suggested change
Cypress.Commands.add('deleteAllRules', () => {
Cypress.Commands.add('alerting:deleteAllRules', () => {

I think that will come handy as we add more commands in the future.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I suppose : is not supported. But maybe we can find another separator

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made this a command because it looked like the kind of thing that was expected in Cypress, but after reading https://docs.cypress.io/api/cypress-api/custom-commands#Best-Practices, I might just go back to making it a function in the rules test, since that's the only place it's used.

@smith smith requested a review from cauemarcondes October 15, 2021 14:27
/^x-pack\/plugins\/security_solution/,
/^x-pack\/test\/security_solution_cypress/,
/^x-pack\/plugins\/triggers_actions_ui\/public\/application\/sections\/action_connector_form/,
/^x-pack\/plugins\/triggers_actions_ui\/public\/application\/context\/actions_connectors_context\.tsx/,
]) || process.env.GITHUB_PR_LABELS.includes('ci:all-cypress-suites')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this change is from Prettier.

@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
apm 2.7MB 2.7MB +36.0B

History

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

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

@smith it looks like when this week is selected both options show up, while it should only show week before.

Screen Shot 2021-10-15 at 1 38 52 PM

Copy link
Contributor

@cauemarcondes cauemarcondes 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 we should fix the comparison bug on another PR.

@smith
Copy link
Contributor Author

smith commented Oct 15, 2021

LGTM, but we should fix the comparison bug on another PR.

Thanks @cauemarcondes. I opened #115247.

@smith smith merged commit 07777b9 into elastic:master Oct 15, 2021
@smith smith deleted the nls/fix-e2e branch October 15, 2021 18:25
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 15, 2021
* Re-enable previously disabled APM E2E tests.
* Round to the nearest second in `getComparisonTypes` to avoid cases where a millisecond difference can change which results get shown.
* Simplify error count alert tests to test the "happy path" (elastic#79284 exists in order to expand to more tests for rule editing and creation.)
* Wait for alert list API request to complete before clicking "Create rule" button when running the test to create a rule from the Stack Management UI.

I ran the e2e tests 100 times locally with no failures so I'm confident the flakiness has been addressed.

Fixes elastic#114419.
Fixes elastic#109205.
@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 Oct 15, 2021
* Re-enable previously disabled APM E2E tests.
* Round to the nearest second in `getComparisonTypes` to avoid cases where a millisecond difference can change which results get shown.
* Simplify error count alert tests to test the "happy path" (#79284 exists in order to expand to more tests for rule editing and creation.)
* Wait for alert list API request to complete before clicking "Create rule" button when running the test to create a rule from the Stack Management UI.

I ran the e2e tests 100 times locally with no failures so I'm confident the flakiness has been addressed.

Fixes #114419.
Fixes #109205.

Co-authored-by: Nathan L Smith <[email protected]>
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:APM All issues that need APM UI Team support v7.16.0 v8.0.0
Projects
None yet
7 participants