Cloud Posture automates the identification and remediation of risks across cloud infrastructures
Read Kibana Contributing Guide for more details
For general guidelines, read Kibana Testing Guide for more details
- Unit Tests (Jest) - located in sibling files to the source code
- API Integration Tests
- Telemetry Integration Tests
- End-to-End Tests
- Serverless API Integration tests
- Serverless End-to-End Tests
Run TypeScript:
node scripts/type_check.js --project=x-pack/plugins/cloud_security_posture/tsconfig.json
Run ESLint:
yarn lint:es x-pack/plugins/cloud_security_posture
Run i18n check:
node scripts/i18n_check.js
Note
i18n should run on project scope as it checks translations files outside of our plugin.
Fixes can be applied using the --fix flag
Run Unit Tests:
yarn test:jest --config x-pack/plugins/cloud_security_posture/jest.config.js
Note
for a coverage report, add the
--coverage
flag, and runopen target/kibana-coverage/jest/x-pack/plugins/cloud_security_posture/index.html
Run Integration Tests:
yarn test:ftr --config x-pack/test/api_integration/config.ts
Run End-to-End Tests:
yarn test:ftr --config x-pack/test/cloud_security_posture_functional/config.ts
yarn test:ftr --config x-pack/test/api_integration/apis/cloud_security_posture/config.ts
yarn test:ftr --config x-pack/test/cloud_security_posture_api/config.ts
yarn test:ftr --config x-pack/test_serverless/api_integration/test_suites/security/config.ts --include-tag=cloud_security_posture
yarn test:ftr --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts
Functional test runner (FTR) can be used separately with ftr:runner
and ftr:server
. This is convenient while developing tests.
For example,
run ESS (stateful) api integration tests:
yarn test:ftr:server --config x-pack/test/api_integration/config.ts
yarn test:ftr:runner --config x-pack/test/api_integration/apis/cloud_security_posture/config.ts
run ESS (stateful) telemetry integration tests:
yarn test:ftr:server --config x-pack/test/cloud_security_posture_api/config.ts
yarn test:ftr:runner --config x-pack/test/cloud_security_posture_api/config.ts
run ESS (stateful) e2e tests:
yarn test:ftr:server --config x-pack/test/cloud_security_posture_functional/config.ts
yarn test:ftr:runner --config x-pack/test/cloud_security_posture_functional/config.ts
run serverless api integration tests:
yarn test:ftr:server --config x-pack/test_serverless/api_integration/test_suites/security/config.ts
yarn test:ftr:runner --config x-pack/test_serverless/api_integration/test_suites/security/config.ts --include-tag=cloud_security_posture
run serverless e2e tests:
yarn test:ftr:server --config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts
yarn test:ftr:runner ---config x-pack/test_serverless/functional/test_suites/security/config.cloud_security_posture.ts