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 - update common serverless API tests to use API keys #180834

Closed
18 tasks done
pheyos opened this issue Apr 15, 2024 · 2 comments
Closed
18 tasks done

FTR - update common serverless API tests to use API keys #180834

pheyos opened this issue Apr 15, 2024 · 2 comments
Assignees
Labels
rca-action Team:QA Team label for QA Team

Comments

@pheyos
Copy link
Member

pheyos commented Apr 15, 2024

Serverless API tests should run with API keys (as that's how the users are supposed to use the APIs in serverless).
Contributes to meta issue #183512

Support and an example have been added already: #178558
See also the example in the README: https://github.com/elastic/kibana/blob/main/x-pack/test_serverless/README.md#api-integration-test-example

We want to update the common tests and figure out the minimum required role.
Similar to what have been done for the UI side in #176221

Folders from x-pack/test_serverless/api_integration/test_suites/common/

Tasks

@botelastic botelastic bot added the needs-team Issues missing a team label label Apr 15, 2024
@wayneseymour wayneseymour added the Team:QA Team label for QA Team label Apr 16, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-qa (Team:QA)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Apr 16, 2024
wayneseymour added a commit that referenced this issue May 15, 2024
…181741)

## Summary

Contributes to: #180834

Update the below common tests, and figure out the minimum required role.

### More Info

 - Add type for `InternalRequestHeader`
 - Add type for `SupertestWithoutAuth`
- Add shortcut method: `createApiKeyForDefaultRole` to `Serverless User
Manager` service
 - Change all calls of `await supertest` to `await supertestWithoutAuth`
- Add Internal Request and Role Credential headers to every `await
supertestWithoutAuth` http call
- Use the lowest role credential possible for all calls, whether
`viewer`, `editor`, `developer`, or `admin`

### Covers these folders:
`x-pack/test_serverless/api_integration/test_suites/common/console`
`x-pack/test_serverless/api_integration/test_suites/common/core`

`x-pack/test_serverless/api_integration/test_suites/common/data_view_field_editor`

`x-pack/test_serverless/api_integration/test_suites/common/elasticsearch_api`

`x-pack/test_serverless/api_integration/test_suites/common/grok_debugger`

`x-pack/test_serverless/api_integration/test_suites/common/kql_telemetry`

`x-pack/test_serverless/api_integration/test_suites/common/scripts_tests`

`x-pack/test_serverless/api_integration/test_suites/common/search_profiler`
`x-pack/test_serverless/api_integration/test_suites/common/search_xpack`

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
wayneseymour added a commit that referenced this issue May 24, 2024
…183386)

Use api keys for api calls, to act as the user, within:
`x-pack/test_serverless/api_integration/test_suites/common/data_views/`

Contributes to: #180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
wayneseymour added a commit that referenced this issue May 28, 2024
…to use api keys (#184304)

## Summary

Use api keys for api calls, to act as the user, within:
`x-pack/test_serverless/api_integration/test_suites/common/management/`
&&

`x-pack/test_serverless/api_integration/test_suites/common/painless_lab/`

Contributes to: #180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
kaanyalti pushed a commit to kaanyalti/kibana that referenced this issue May 28, 2024
…to use api keys (elastic#184304)

## Summary

Use api keys for api calls, to act as the user, within:
`x-pack/test_serverless/api_integration/test_suites/common/management/`
&&

`x-pack/test_serverless/api_integration/test_suites/common/painless_lab/`

Contributes to: elastic#180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rshen91 pushed a commit to rshen91/kibana that referenced this issue May 30, 2024
…lastic#183386)

Use api keys for api calls, to act as the user, within:
`x-pack/test_serverless/api_integration/test_suites/common/data_views/`

Contributes to: elastic#180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
rshen91 pushed a commit to rshen91/kibana that referenced this issue May 30, 2024
…to use api keys (elastic#184304)

## Summary

Use api keys for api calls, to act as the user, within:
`x-pack/test_serverless/api_integration/test_suites/common/management/`
&&

`x-pack/test_serverless/api_integration/test_suites/common/painless_lab/`

Contributes to: elastic#180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
wayneseymour added a commit that referenced this issue Jun 5, 2024
…183381)

## Summary

- update api tests in
`x-pack/test_serverless/api_integration/test_suites/common/alerting/`
- update ui tests in:
  - `x-pack/test_serverless/functional/test_suites/observability/rules`
  - `x-pack/test_serverless/functional/test_suites/search/rules/`

Contributes to: #180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
wayneseymour added a commit to wayneseymour/kibana that referenced this issue Jun 6, 2024
wayneseymour added a commit to wayneseymour/kibana that referenced this issue Jun 10, 2024
wayneseymour added a commit to wayneseymour/kibana that referenced this issue Jun 11, 2024
…i keys

Contributes to: elastic#180834

# Conflicts:
#	x-pack/test_serverless/api_integration/test_suites/security/common_configs/config.group1.ts
wayneseymour added a commit to wayneseymour/kibana that referenced this issue Jun 12, 2024
…i keys

Contributes to: elastic#180834

# Conflicts:
#	x-pack/test_serverless/api_integration/test_suites/security/common_configs/config.group1.ts
wayneseymour added a commit to wayneseymour/kibana that referenced this issue Jun 13, 2024
…i keys

Contributes to: elastic#180834

# Conflicts:
#	x-pack/test_serverless/api_integration/test_suites/security/common_configs/config.group1.ts
wayneseymour added a commit to wayneseymour/kibana that referenced this issue Jun 19, 2024
wayneseymour added a commit that referenced this issue Jun 20, 2024
…185030)

## Summary
- update api tests in
`x-pack/test_serverless/api_integration/test_suites/common/search_oss/`



Contributes to: #180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
wayneseymour added a commit that referenced this issue Jun 21, 2024
…i keys (#184935)

## Summary

- Update files within:
`x-pack/test_serverless/api_integration/test_suites/common/platform_security/`

Contributes to: #180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
wayneseymour added a commit that referenced this issue Jun 21, 2024
…184819)

## Summary

- update api tests in
`x-pack/test_serverless/api_integration/test_suites/common/reporting/`
- update one ui test in
`x-pack/test_serverless/functional/test_suites/common/reporting/management.ts`
- update snapshot
`x-pack/test_serverless/api_integration/test_suites/common/reporting/__snapshots__/generate_csv_discover.snap`
- update shared service in
`x-pack/test_serverless/shared/services/svl_reporting.ts`


Contributes to: #180834

---------

Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
seanrathier pushed a commit to seanrathier/kibana that referenced this issue Jun 21, 2024
…lastic#185030)

## Summary
- update api tests in
`x-pack/test_serverless/api_integration/test_suites/common/search_oss/`



Contributes to: elastic#180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
bhapas pushed a commit to bhapas/kibana that referenced this issue Jun 24, 2024
…lastic#185030)

## Summary
- update api tests in
`x-pack/test_serverless/api_integration/test_suites/common/search_oss/`



Contributes to: elastic#180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
bhapas pushed a commit to bhapas/kibana that referenced this issue Jun 24, 2024
…i keys (elastic#184935)

## Summary

- Update files within:
`x-pack/test_serverless/api_integration/test_suites/common/platform_security/`

Contributes to: elastic#180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
bhapas pushed a commit to bhapas/kibana that referenced this issue Jun 24, 2024
…lastic#184819)

## Summary

- update api tests in
`x-pack/test_serverless/api_integration/test_suites/common/reporting/`
- update one ui test in
`x-pack/test_serverless/functional/test_suites/common/reporting/management.ts`
- update snapshot
`x-pack/test_serverless/api_integration/test_suites/common/reporting/__snapshots__/generate_csv_discover.snap`
- update shared service in
`x-pack/test_serverless/shared/services/svl_reporting.ts`


Contributes to: elastic#180834

---------

Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
umbopepato pushed a commit to umbopepato/kibana that referenced this issue Jul 5, 2024
…lastic#185030)

## Summary
- update api tests in
`x-pack/test_serverless/api_integration/test_suites/common/search_oss/`



Contributes to: elastic#180834

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
wayneseymour added a commit that referenced this issue Jul 8, 2024
… keys (#184105)

## Summary

Use api keys for api calls, to act as a real user **not the operator
user,** within:
`x-pack/test_serverless/api_integration/test_suites/common/index_management/`

Update `test_serverless/README.md`

## Important (More helpers)
In order to create severless versions of statefull helpers that require
role credentials, the pr adds a number of helpers to
`x-pack/test_serverless/api_integration/services/index_management/svl_*.ts`
With these additions, any given serverless api integration test can call
the serverless version of a helper, and the stateful version of the
helper, is left untouched.
Further, the type checker is satisfied (cant share code across
boundaries, etc. mostly within the tsconfig.json files).

## For Reviewers
### Issues raised:
index_templates: #187368
datastreams: #187372
settings: #187369

Contributes to: #180834

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@pheyos
Copy link
Member Author

pheyos commented Jul 8, 2024

Initial migration on the platform side is done.

@pheyos pheyos closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rca-action Team:QA Team label for QA Team
Projects
None yet
Development

No branches or pull requests

4 participants