Setup E2E against Serverless ES, Kibana, Fleet server standalone and Elastic endpoint agent in VM#167720
Conversation
…cypress # Conflicts: # x-pack/test/security_solution_cypress/cypress/support/old_headless.ts # x-pack/test_serverless/functional/test_suites/security/cypress/cypress.config.ts # yarn.lock
…cypress # Conflicts: # package.json # packages/kbn-management/settings/components/field_row/__stories__/common.tsx # packages/kbn-management/settings/components/field_row/description/deprecation.test.tsx # x-pack/plugins/fleet/package.json # x-pack/plugins/threat_intelligence/package.json # x-pack/test_serverless/functional/test_suites/observability/cypress/package.json # x-pack/test_serverless/functional/test_suites/security/cypress/package.json # yarn.lock
…-ref HEAD~1..HEAD --fix'
x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts
Show resolved
Hide resolved
paul-tavares
left a comment
There was a problem hiding this comment.
Left some comments, but ok to merge 👍
...y_solution/public/management/cypress/e2e/response_actions/response_console_mocked_data.cy.ts
Show resolved
Hide resolved
| return u.toString(); | ||
| })(); | ||
|
|
||
| export const waitForKibana = async (kbnClient: KbnClient): Promise<void> => { |
There was a problem hiding this comment.
can you edit the @param above in the jsdocs to match the new param name
There was a problem hiding this comment.
FYI: I seem to being able to use kbnClient for some reason when I initially added this method, but don't recall what that was now. Did you test this code here to ensure it works? (ex. ensuring that the pRetry() below is executes the callback at least twice)
There was a problem hiding this comment.
yes, I did, the previous solution was failing due to the nodeFetch missing cert for SSL endpoints
x-pack/plugins/security_solution/scripts/endpoint/common/stack_services.ts
Outdated
Show resolved
Hide resolved
…ykkopycinski/kibana into feat/dw-serverless-endpoint-cypress
maximpn
left a comment
There was a problem hiding this comment.
@patrykkopycinski thank you for making it possible to run Fleet server standalone in Servelress 🙏
I'm good with the changes, left some minor comments.
|
|
||
| export const getLocalhostRealIp = (): string | undefined => { | ||
| for (const netInterfaceList of Object.values(networkInterfaces())) { | ||
| if (netInterfaceList) { |
There was a problem hiding this comment.
nit: this could be simplified for improved readability
| if (netInterfaceList) { | |
| const address = netInterfaceList?.find( | |
| (networkInterface) => | |
| networkInterface.family === 'IPv4' && | |
| networkInterface.internal === false && | |
| networkInterface.address | |
| )?.address; | |
| if (address) { | |
| return address; | |
| } |
packages/kbn-es/src/utils/docker.ts
Outdated
| const realLocalhostIp = getLocalhostRealIp(); | ||
|
|
||
| if (realLocalhostIp) { | ||
| value.push('-p', `${realLocalhostIp}:${port}:${port}`); |
There was a problem hiding this comment.
I'm curious why it was necessary to add real address while it wasn't necessary in #165415?
There was a problem hiding this comment.
because in previous case all the containers are running on the Docker and in this case we need to be able to reach the ES docker container from the VM running via Vagrant on the host machine
|
|
||
| const getEsPort = <T>(): T | number => { | ||
| if (isOpen) { | ||
| return 9220; |
There was a problem hiding this comment.
nit: Avoid hardcoded values. Is there a chance the port changes and this file must be updated as well?
There was a problem hiding this comment.
nope, 9220 is the default port we are using in our FTR tests
| }; | ||
|
|
||
| describe('Artifacts pages', { tags: '@ess' }, () => { | ||
| describe('Artifacts pages', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { |
There was a problem hiding this comment.
Is the test really broken in Serverless or you wanna just skip it for now? @skipInServerless tag could be a better choice, see here
There was a problem hiding this comment.
to me, it seems both tags are doing the same, maybe we could simplify and just have one tag for both use cases?
| import { login, ROLE } from '../../tasks/login'; | ||
|
|
||
| describe('Form', { tags: '@ess' }, () => { | ||
| describe('Form', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { |
There was a problem hiding this comment.
Is the test really broken in Serverless or you wanna just skip it for now? @skipInServerless tag could be a better choice, see here
jbudz
left a comment
There was a problem hiding this comment.
Small comment, otherwise kbn-test, kbn-es, and ftr_configs.yml LGTM
|
|
||
| export interface ServerlessOptions extends EsClusterExecOptions, BaseOptions { | ||
| /** Publish ES docker container on additional host IP */ | ||
| host?: string; |
There was a problem hiding this comment.
Can we add this to the cli --help to https://github.com/elastic/kibana/blob/main/packages/kbn-es/src/cli_commands/serverless.ts#L37?
| if ((options as ServerlessOptions).host) { | ||
| value.push('-p', `${(options as ServerlessOptions).host}:${port}:${port}`); | ||
| } |
There was a problem hiding this comment.
Just curious if this change needed for Cypress tests or as a general capability to improve developer UX?
If we are keeping the function name resolvePort as is, could you update the description to have few words about host usage and return value.
There was a problem hiding this comment.
this change is needed to improve dev UX, mostly in case we want to set elastic-agent on a dedicated VM outside of the Docker network
There was a problem hiding this comment.
@dmlemeshko updated description, please let me know if that works
dmlemeshko
left a comment
There was a problem hiding this comment.
kbn-test changes LGTM
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
Summary
Run Defend Workflows Cypress E2E against Serverless stack, similar to #165415