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

[ftr] fix test users for serverless #161280

Merged
merged 8 commits into from
Jul 10, 2023

Conversation

dmlemeshko
Copy link
Member

@dmlemeshko dmlemeshko commented Jul 5, 2023

Summary

This PR fixes few issues occurring while running FTR API tests against actual serverless project.

How to run:

TEST_CLOUD=1 ES_SECURITY_ENABLED=1 NODE_TLS_REJECT_UNAUTHORIZED=0 TEST_ES_URL=<your_es_url_with_credentials> TEST_KIBANA_URL=<your_es_url_with_credentials> node  --no-warnings scripts/functional_test_runner --es-version=8.9.0 --config x-pack/test_serverless/api_integration/test_suites/search/config.ts --bail

The first error is faced during Elasticsearch version validation

ERROR Error: attempted to use the "es" service to fetch Elasticsearch version info but the request failed: ResponseError: {"ok":false,"message":"Unknown resource."}
          at SniffingTransport.request (/Users/dmle/github/kibana/node_modules/@elastic/transport/src/Transport.ts:535:17)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at Client.InfoApi [as info] (/Users/dmle/github/kibana/node_modules/@elastic/elasticsearch/src/api/api/info.ts:60:10)
          at FunctionalTestRunner.validateEsVersion (functional_test_runner.ts:129:16)
          at functional_test_runner.ts:64:11
          at FunctionalTestRunner.runHarness (functional_test_runner.ts:251:14)
          at FunctionalTestRunner.run (functional_test_runner.ts:48:12)
          at log.defaultLevel (cli.ts:112:32)
          at run.ts:70:7
          at withProcRunner (with_proc_runner.ts:29:5)
          at run (run.ts:69:5)
          at FunctionalTestRunner.validateEsVersion (functional_test_runner.ts:131:13)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at functional_test_runner.ts:64:11
          at FunctionalTestRunner.runHarness (functional_test_runner.ts:251:14)
          at FunctionalTestRunner.run (functional_test_runner.ts:48:12)
          at log.defaultLevel (cli.ts:112:32)
          at run.ts:70:7
          at withProcRunner (with_proc_runner.ts:29:5)
          at run (run.ts:69:5)

Since there is no version term in case of serverless, we can skip version check by using newly added to FTR schema serverless property (false by default). It is set to true in root FTR config /shared/config.base.

The next error is related to ESArchiver relying on ES FTR service to provide ESClient.

ResponseError: security_exception
   │ 	Root causes:
   │ 		security_exception: unable to authenticate user [system_indices_superuser] for REST request [/kibana_sample_data_flights]

It is fixed by using the default user (from host url) instead of system_indices_superuser we use in stateful run.

@dmlemeshko dmlemeshko marked this pull request as ready for review July 6, 2023 15:22
@dmlemeshko dmlemeshko requested review from a team as code owners July 6, 2023 15:22
@dmlemeshko dmlemeshko requested review from pheyos and wayneseymour July 6, 2023 15:23
@dmlemeshko dmlemeshko added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.10.0 labels Jul 6, 2023
@@ -200,7 +201,7 @@ export const schema = Joi.object()
.keys({
license: Joi.valid('basic', 'trial', 'gold').default('basic'),
from: Joi.string().default('snapshot'),
serverArgs: Joi.array().items(Joi.string()),
serverArgs: Joi.array().items(Joi.string()).default([]),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will help us to clean code a bit and avoid config.get('esTestCluster.serverArgs') || [] in many places

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 408 412 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 487 491 +4
total +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@Ikuni17 Ikuni17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ops changes lgtm

Copy link
Member

@pheyos pheyos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉
Tested all six configurations locally and against serverless QA projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants