kibana icon indicating copy to clipboard operation
kibana copied to clipboard

[Entity Analytics] Remove before and after hooks from Cypress tests

Open MadameSheema opened this issue 1 year ago • 6 comments

Relates to:

https://github.com/elastic/kibana/issues/173327 https://github.com/elastic/kibana/issues/174247

Get rid of the before and after hooks in favor of the beforeEach and afterEach hooks. Or at least make sure that the code executed in the before and after hook is not prone to fail (i.e. es_archiver).

MadameSheema avatar Jan 17 '24 13:01 MadameSheema

Pinging @elastic/security-solution (Team: SecuritySolution)

elasticmachine avatar Jan 17 '24 13:01 elasticmachine

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

elasticmachine avatar Jan 17 '24 13:01 elasticmachine

👋 Hey there @MadameSheema! Is there a list of test cases that need to have this change made? If not, I'll get with the team to assess how many instances of this we have within Entity Analytics tests.

Additionally, do we have a timeline for when we want this completed for the second quality gate?

jaredburgettelastic avatar Jan 17 '24 22:01 jaredburgettelastic

Edit: missed that this is only relevant for cypress tests 🤦 so no need for tasks

currently these are the files I found based on our code ownership, going to split into 2 subtasks, one for cypress and one for integration

## integration
x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/asset_criticality_privileges.ts
x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_engine_privileges.ts
x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_score_calculation.ts
x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_score_preview.ts
x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution.ts
x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_scoring_task/task_execution_nondefault_spaces.ts
x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/telemetry_usage.ts

## cypress
x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/dashboards/entity_analytics.cy.ts
x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/dashboards/upgrade_risk_score.cy.ts
x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/enrichments.cy.ts
x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts
x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_flyout.cy.ts
x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/host_details/risk_tab.cy.ts
x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/host_risk_tab.cy.ts
x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/hosts/hosts_risk_column.cy.ts

hop-dev avatar Feb 14 '24 10:02 hop-dev

@MadameSheema could you confirm if we should do the same for FTR tests, or only for Cypress? (regarding @hop-dev 's comment above)

jaredburgettelastic avatar Feb 15 '24 20:02 jaredburgettelastic

@MadameSheema could you confirm if we should do the same for FTR tests, or only for Cypress? (regarding @hop-dev 's https://github.com/elastic/kibana/issues/175023#issuecomment-1943494281)

Cypress :)

MadameSheema avatar Feb 16 '24 10:02 MadameSheema

PR ready just runnning flaky test runner https://github.com/elastic/kibana/pull/177175

Only very small changes were needed, we primarily used only the archiver in our before and after calls.

hop-dev avatar Feb 19 '24 13:02 hop-dev