[Defend Workflows] Add tags for mocked and real Endpoint Cypress tests for Serverless#165094
Conversation
2279454 to
f6e7a5c
Compare
0b52f93 to
b4d1246
Compare
|
Pinging @elastic/security-defend-workflows (Team:Defend Workflows) |
...ck/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts
Outdated
Show resolved
Hide resolved
paul-tavares
left a comment
There was a problem hiding this comment.
awesome job here. Thansk for taking this on and for all the changes to enable this.
Left a round of feedback - let me know if you have any questions.
Once thing I wanted to follow up on - perhaps best in our team channel or during our weekly eng. hour:
- What are all of the approved tags to use? are they documented somewhere? Also - might be good to add documentation it to our cypress README file.
- What happens to a test that has no
tags? I had (incorrectly?) assumed that all tests would continue to be picked up and ran in ESS, only those with@serverlesswould be executed in serverless. but given this PR, it leads me to belive that tags are always required? If so, is there a way to catch and error a test that has notags?
| const parseRevNumber = (revString: string) => Number(revString.match(/\d+/)?.[0]); | ||
|
|
||
| describe('Artifact pages', () => { | ||
| describe('Artifact pages', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { |
There was a problem hiding this comment.
It would be great if we could type this new property (tags) so that we get content assist. Can you add that to our cypress.d.ts file here:
There was a problem hiding this comment.
Actually - looks like tags is already defined via @cypress types so need to add to the our cypress.d.ts file. I do wonder if there is a way to make the type more specific in that it can suggest our "known" tags 🤔
There was a problem hiding this comment.
I did some experiments with types to be able to have suggestions, but didn't work so far, exactly because tags are already defined in cypress.d.ts, and therefore it cannot be overriden by a more exact type.
one solution would be to use our own security_tags or something, but I'm not sure if grep can pick it up - I'll look into this, but this is definitely an open question.
There was a problem hiding this comment.
no big deal. it would just help with DX. Don't hold this PR because of this.
x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/artifacts.cy.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/management/cypress/.eslintrc.json
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/management/cypress/cypress.config.ts
Outdated
Show resolved
Hide resolved
...ck/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts
Outdated
Show resolved
Hide resolved
| - exit_status: '*' | ||
| limit: 1 | ||
|
|
||
| - command: .buildkite/scripts/steps/functional/defend_workflows_serverless.sh |
There was a problem hiding this comment.
Do we only want this to run conditionally on pull requests?
on-merge at https://github.com/elastic/kibana/blob/main/.buildkite/pipelines/on_merge.yml#L82
all pull requests at https://github.com/elastic/kibana/blob/main/.buildkite/pipelines/pull_request/base.yml#L71
There was a problem hiding this comment.
thanks for the question! I've added it to our tracking issue for serverless tests, to make a team decision - until then, for this PR, I'd keep it this way to merge this as soon as possible.
...ck/plugins/security_solution/public/management/cypress/cypress_endpoint_serverless.config.ts
Show resolved
Hide resolved
| import { dataLoaders } from './cypress/support/data_loaders'; | ||
|
|
||
| export default defineCypressConfig({ | ||
| export const CY_BASE_CONFIG = { |
There was a problem hiding this comment.
Suggestion: turn this into a function that returns the config object so that there is no concern around someone accidentally mutating this object. Or, use Object.freeze() on it (although, tht is also not a deep freeze)
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Summary
cypress:dw:serverless:openand:runcypress:dw:endpoint:serverless:openand:run@serverlessand@brokenInServerlesstests, because of other issues to be solved,x-pack/plugins/security_solution/public/management/cypress/e2e/mocked_data/policy_details.cy.ts