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

[8.x] [Security Solution][Endpoint] Cypress test improvements to capture Agent diagnostics file when test fails (#202965) #204485

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

paul-tavares
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

…ent diagnostics file when test fails (elastic#202965)

## Summary

- the Cypress `parallel` runner was updated to set tooling logging level
first from Env. variables before falling back to the value defined in
the Cypress configuration file
- The env. value to set, if wanting to enable a specific logging level,
is `TOOLING_LOG_LEVEL`. The values supported are the same as those used
with `ToolingLog`
([here](https://github.com/elastic/kibana/blob/b6287708f687d4e3288851052c0c6ae4ade8ce60/packages/kbn-tooling-log/src/log_levels.ts#L10)):
`silent`, `error`, `warning`, `success`, `info`, `debug`, `verbose`
- This change makes it easier to run Cypress tests locally with (for
example) a logging level of `verbose` for our tooling without having to
modify the Cypress configuration file. Example: `export
TOOLING_LOG_LEVEL=verbose && yarn cypress:dw:open`
- Added two new methods to our scripting VM service clients (for Vagrant
and Multipass):
- `download`: allow you to pull files out of the VM and save them
locally
- `upload`: uploads a local file to the VM. (upload already existed as
`transfer` - which has now been marked as deprecated).
- Added new service function on our Fleet scripting module to enable us
to set the logging level on a Fleet Agent
- Cypress tests were adjusted to automatically set the agent logging to
debug when running in CI
- A new Cypress task that allows for an Agent Diagnostic file (which
includes the Endpoint Log) to be retrieved from the host VM and stored
with the CI job (under the artifacts tab)
    - A few tests were updated to include this step for failed test

(cherry picked from commit 2ab8a5c)

# Conflicts:
#	x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 571 572 +1

Total ESLint disabled count

id before after diff
securitySolution 655 656 +1

History

@paul-tavares paul-tavares merged commit 0350dd2 into elastic:8.x Dec 17, 2024
8 checks passed
@paul-tavares paul-tavares deleted the backport/8.x/pr-202965 branch December 17, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants