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

[APM] Migrate inspect API tests to be deployment-agnostic #199963

Conversation

iblancof
Copy link
Contributor

@iblancof iblancof commented Nov 13, 2024

How to test

Closes #198977
Part of #193245

This PR contains the changes to migrate inspect test folder to deployment-agnostic testing strategy.

How to test

  • Serverless
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --grep="APM"

It's recommended to be run against MKI

  • Stateful
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --grep="APM"

Checks

  • (OPTIONAL, only if a test has been unskipped) Run flaky test suite
  • local run for serverless
  • local run for stateful
  • MKI run for serverless

@iblancof iblancof requested review from a team as code owners November 13, 2024 09:46
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team labels Nov 13, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@iblancof iblancof self-assigned this Nov 13, 2024
@iblancof iblancof added release_note:skip Skip the PR/issue when compiling release notes apm backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) v8.17.0 labels Nov 13, 2024
expect(status).to.be(200);
expect(body._inspect).to.eql([]);
});

it('for agent configs', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test can’t be migrated because it involves Agent Configuration, which isn’t available in serverless.

Copy link
Member

@wayneseymour wayneseymour left a comment

Choose a reason for hiding this comment

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

Just one question.

import archives_metadata from '../constants/archives_metadata';

export default function inspectFlagTests({ getService }: DeploymentAgnosticFtrProviderContext) {
const apmApiClient = getService('apmApi');
Copy link
Member

Choose a reason for hiding this comment

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

Does this apmApiClient need any cleanup in an after method?
Perhaps that's already occuring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I know, it’s not necessary.
This service acts as a gateway for API requests.

It’s used in nearly all our test files, and we use it in the same way across them.

Copy link
Contributor

Choose a reason for hiding this comment

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

apmApi doesn't need any clean up.

@iblancof iblancof changed the title [APM] Migrate inspect API tests to be deployment-agnostic #199802 [APM] Migrate inspect API tests to be deployment-agnostic Nov 13, 2024
Copy link
Contributor

@rmyz rmyz left a comment

Choose a reason for hiding this comment

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

LGTM!

…tests-inspect-to-be-deployment-agnostic-api-tests
…tests-inspect-to-be-deployment-agnostic-api-tests
Copy link
Contributor

@crespocarlos crespocarlos left a comment

Choose a reason for hiding this comment

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

LGTM.

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 14, 2024

💚 Build Succeeded

  • Buildkite Build
  • Commit: d34801c
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-199963-d34801c05631

Metrics [docs]

✅ unchanged

History

cc @iblancof

@iblancof iblancof merged commit bb68f92 into elastic:main Nov 14, 2024
23 checks passed
@iblancof iblancof deleted the 198977-apm-migrate-test-apm_api_integration-tests-inspect-to-be-deployment-agnostic-api-tests branch November 14, 2024 13:33
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11838271075

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 14, 2024
…9963)

### How to test
Closes elastic#198977
Part of elastic#193245

This PR contains the changes to migrate `inspect` test folder to
deployment-agnostic testing strategy.

### How to test

- Serverless

```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --grep="APM"
```

It's recommended to be run against
[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)

- Stateful
```
node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --grep="APM"
```

## Checks

- [ ] (OPTIONAL, only if a test has been unskipped) Run flaky test suite
- [x] local run for serverless
- [x] local run for stateful
- [x] MKI run for serverless

(cherry picked from commit bb68f92)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 14, 2024
) (#200179)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[APM] Migrate inspect API tests to be deployment-agnostic
(#199963)](#199963)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Irene
Blanco","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-14T13:33:32Z","message":"[APM]
Migrate inspect API tests to be deployment-agnostic (#199963)\n\n### How
to test\r\nCloses
https://github.com/elastic/kibana/issues/198977\r\nPart of
https://github.com/elastic/kibana/issues/193245\r\n\r\nThis PR contains
the changes to migrate `inspect` test folder to\r\ndeployment-agnostic
testing strategy.\r\n\r\n### How to test\r\n\r\n\r\n-
Serverless\r\n\r\n```\r\nnode scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
--grep=\"APM\"\r\n```\r\n\r\nIt's recommended to be run
against\r\n[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)\r\n\r\n-
Stateful\r\n```\r\nnode scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
--grep=\"APM\"\r\n```\r\n\r\n## Checks\r\n\r\n- [ ] (OPTIONAL, only if a
test has been unskipped) Run flaky test suite\r\n- [x] local run for
serverless\r\n- [x] local run for stateful\r\n- [x] MKI run for
serverless","sha":"bb68f92ec02ad4f9da2f15c978842685159012e1","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","apm","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.17.0"],"title":"[APM]
Migrate inspect API tests to be
deployment-agnostic","number":199963,"url":"https://github.com/elastic/kibana/pull/199963","mergeCommit":{"message":"[APM]
Migrate inspect API tests to be deployment-agnostic (#199963)\n\n### How
to test\r\nCloses
https://github.com/elastic/kibana/issues/198977\r\nPart of
https://github.com/elastic/kibana/issues/193245\r\n\r\nThis PR contains
the changes to migrate `inspect` test folder to\r\ndeployment-agnostic
testing strategy.\r\n\r\n### How to test\r\n\r\n\r\n-
Serverless\r\n\r\n```\r\nnode scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
--grep=\"APM\"\r\n```\r\n\r\nIt's recommended to be run
against\r\n[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)\r\n\r\n-
Stateful\r\n```\r\nnode scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
--grep=\"APM\"\r\n```\r\n\r\n## Checks\r\n\r\n- [ ] (OPTIONAL, only if a
test has been unskipped) Run flaky test suite\r\n- [x] local run for
serverless\r\n- [x] local run for stateful\r\n- [x] MKI run for
serverless","sha":"bb68f92ec02ad4f9da2f15c978842685159012e1"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199963","number":199963,"mergeCommit":{"message":"[APM]
Migrate inspect API tests to be deployment-agnostic (#199963)\n\n### How
to test\r\nCloses
https://github.com/elastic/kibana/issues/198977\r\nPart of
https://github.com/elastic/kibana/issues/193245\r\n\r\nThis PR contains
the changes to migrate `inspect` test folder to\r\ndeployment-agnostic
testing strategy.\r\n\r\n### How to test\r\n\r\n\r\n-
Serverless\r\n\r\n```\r\nnode scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts
--grep=\"APM\"\r\n```\r\n\r\nIt's recommended to be run
against\r\n[MKI](https://github.com/crespocarlos/kibana/blob/main/x-pack/test_serverless/README.md#run-tests-on-mki)\r\n\r\n-
Stateful\r\n```\r\nnode scripts/functional_tests_server --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts\r\nnode
scripts/functional_test_runner --config
x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts
--grep=\"APM\"\r\n```\r\n\r\n## Checks\r\n\r\n- [ ] (OPTIONAL, only if a
test has been unskipped) Run flaky test suite\r\n- [x] local run for
serverless\r\n- [x] local run for stateful\r\n- [x] MKI run for
serverless","sha":"bb68f92ec02ad4f9da2f15c978842685159012e1"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Irene Blanco <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Migrate /test/apm_api_integration/tests/inspect/ to be deployment-agnostic API tests
6 participants