-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APM] Revert deletion of service agent test (#200196)
Closes #198988 Part of #193245 ## Summary Follow up from #199812. The `agent.spec.ts` test was deleted by mistake. ### 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" ``` - [ ] ~(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 --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
b87e47b
commit c473a69
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
...ck/test/api_integration/deployment_agnostic/apis/observability/apm/services/agent.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import expect from '@kbn/expect'; | ||
import archives_metadata from '../../../../../../apm_api_integration/common/fixtures/es_archiver/archives_metadata'; | ||
import type { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; | ||
import { ARCHIVER_ROUTES } from '../constants/archiver'; | ||
|
||
export default function ApiTest({ getService }: DeploymentAgnosticFtrProviderContext) { | ||
const apmApiClient = getService('apmApi'); | ||
const esArchiver = getService('esArchiver'); | ||
|
||
const archiveName = '8.0.0'; | ||
const { start, end } = archives_metadata[archiveName]; | ||
|
||
describe('Agent name', () => { | ||
describe('when data is not loaded', () => { | ||
it('handles the empty state', async () => { | ||
const response = await apmApiClient.readUser({ | ||
endpoint: 'GET /internal/apm/services/{serviceName}/agent', | ||
params: { | ||
path: { serviceName: 'opbeans-node' }, | ||
query: { | ||
start, | ||
end, | ||
}, | ||
}, | ||
}); | ||
|
||
expect(response.status).to.be(200); | ||
expect(response.body).to.eql({}); | ||
}); | ||
}); | ||
|
||
describe('when data is loaded', () => { | ||
before(async () => { | ||
await esArchiver.load(ARCHIVER_ROUTES[archiveName]); | ||
}); | ||
after(async () => { | ||
await esArchiver.unload(ARCHIVER_ROUTES[archiveName]); | ||
}); | ||
|
||
it('returns the agent name', async () => { | ||
const response = await apmApiClient.readUser({ | ||
endpoint: 'GET /internal/apm/services/{serviceName}/agent', | ||
params: { | ||
path: { serviceName: 'opbeans-node' }, | ||
query: { | ||
start, | ||
end, | ||
}, | ||
}, | ||
}); | ||
|
||
expect(response.status).to.be(200); | ||
|
||
expect(response.body).to.eql({ agentName: 'nodejs', runtimeName: 'node' }); | ||
}); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters