[7.x] [SIEM] Run Cypress Tests Against Elastic Cloud & Cypress Command Line / Reporting (#42804)#43315
Merged
andrew-goldstein merged 1 commit intoelastic:7.xfrom Aug 14, 2019
Conversation
Contributor
💔 Build Failed |
… / Reporting (elastic#42804) This PR contains enhancements to the `Cypress` end-to-end (e2e) testing support in the SIEM app, as discussed with @spalger Note: this PR depends on test refactorings in elastic#42766 Cypress tests may now be run against a remote Elastic Cloud instance (override `baseUrl`), interactively or via the command line. Credentials are specified via `kibna.dev.yml` or environment variables. Run tests on the command line (override `baseUrl` and pass credentials via the `CYPRESS_ELASTICSEARCH_USERNAME` and `CYPRESS_ELASTICSEARCH_PASSWORD` environment variables), via command line. Reports are configured to include: - An HTML report, suitable for e-mail notifications - Screenshots - Junit reports (for integration with Kibana CI) - Videos (optional) Reports generated when `Cypress` tests are run on the command line are output to the `target` directory, which follows specific conventions used by the Kibana CI process: * Any directory under `target` that begins with `kibana-`, e.g. `kibana-siem` will be uploaded as an artifact to a bucket * Junit reports are picked up from the `target/junit` directory The artifacts generated by running `Cypress` tests on the command line conform to the above conventions. An HTML report (e.g. for email notifications) is output to: ``` target/kibana-siem/cypress/results/output.html ``` Screenshots of failed tests are output to: ``` target/kibana-siem/cypress/screenshots ``` The Kibana CI process reports `junit` test results from the `target/junit` directory. Cypress `junit` reports are generated in `target/kibana-siem/cypress/results` and copied to the `target/junit` directory. Videos are disabled by default, but can optionally be enabled by setting the `CYPRESS_video=true` environment variable: ``` CYPRESS_video=true yarn cypress:run ``` Videos are (optionally) output to: ``` target/kibana-siem/cypress/videos ``` The full details and instructions for running Cypress tests are in the `siem/cypress/README.md`, which was updated to reflect the changes in this in this PR, but in a nutshell, you may run tests interactively with the following (new) environment variables: ```sh cd x-pack/legacy/plugins/siem CYPRESS_baseUrl=http://localhost:5601 CYPRESS_ELASTICSEARCH_USERNAME=elastic CYPRESS_ELASTICSEARCH_PASSWORD=<password> yarn cypress:open ``` Running the command line version of the tests, which will output the reports described above, is a similar experence: ```sh cd x-pack/legacy/plugins/siem CYPRESS_baseUrl=http://localhost:5601 CYPRESS_ELASTICSEARCH_USERNAME=elastic CYPRESS_ELASTICSEARCH_PASSWORD=<password> yarn cypress:run ``` elastic/siem-team#435 elastic/siem-team#437 - regen yarn.lock
92ca714 to
1aa4f88
Compare
Contributor
💚 Build Succeeded |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports the following commits to 7.x: