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

[Reporting] Log TM health and drift stats prior to reporting tests #117013

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ export default function ({ getService }: FtrProviderContext) {
await reportingAPI.deleteAllReports();
});

// FLAKY: https://github.com/elastic/kibana/issues/93354
describe.skip('Pre 6_2', () => {
describe('Pre 6_2', () => {
// The URL being tested was captured from release 6.4 and then the layout section was removed to test structure before
// preserve_layout was introduced. See https://github.com/elastic/kibana/issues/23414
it('job posted successfully', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {

before(async () => {
const reportingAPI = getService('reportingAPI');
await reportingAPI.checkTaskManagerHealth();
await reportingAPI.createDataAnalystRole();
await reportingAPI.createTestReportingUserRole();
await reportingAPI.createDataAnalyst();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
import { FtrProviderContext } from '../ftr_provider_context';

// eslint-disable-next-line import/no-default-export
export default function ({ loadTestFile }: FtrProviderContext) {
export default function ({ loadTestFile, getService }: FtrProviderContext) {
describe('Reporting API Integration Tests with Security disabled', function () {
before(async () => {
const reportingAPI = getService('reportingAPI');
await reportingAPI.checkTaskManagerHealth();
});
this.tags('ciGroup13');
loadTestFile(require.resolve('./job_apis_csv'));
loadTestFile(require.resolve('./job_apis_csv_deprecated'));
Expand Down
15 changes: 15 additions & 0 deletions x-pack/test/reporting_api_integration/services/scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ export function createScenarios({ getService }: Pick<FtrProviderContext, 'getSer
const REPORTING_USER_USERNAME = 'reporting_user';
const REPORTING_USER_PASSWORD = 'reporting_user-password';

const checkTaskManagerHealth = async () => {
tsullivan marked this conversation as resolved.
Show resolved Hide resolved
// Check task manager health for analyzing test failures. See https://github.com/elastic/kibana/issues/114946
const tmHealth = await supertest.get(`/api/task_manager/_health`);
const driftValues = tmHealth.body?.stats?.runtime?.value;

log.info(`Task Manager status: "${tmHealth.body?.status}"`);
log.info(`Task Manager overall drift rankings: "${JSON.stringify(driftValues?.drift)}"`);
log.info(
`Task Manager drift rankings for "report:execute": "${JSON.stringify(
driftValues?.drift_by_type?.['report:execute']
)}"`
);
};

const initEcommerce = async () => {
await esArchiver.load('x-pack/test/functional/es_archives/reporting/ecommerce');
await kibanaServer.importExport.load(ecommerceSOPath);
Expand Down Expand Up @@ -201,6 +215,7 @@ export function createScenarios({ getService }: Pick<FtrProviderContext, 'getSer
};

return {
checkTaskManagerHealth,
initEcommerce,
teardownEcommerce,
DATA_ANALYST_USERNAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export default function (context: FtrProviderContext) {
this.tags('ciGroup2');

before(async () => {
const reportingAPI = context.getService('reportingAPI');
await reportingAPI.checkTaskManagerHealth();
await createDataAnalystRole();
await createDataAnalyst();
await createReportingUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default function ({ getService, loadTestFile }: FtrProviderContext) {

before(async () => {
const reportingFunctional = getService('reportingFunctional');
await reportingFunctional.checkTaskManagerHealth();
await reportingFunctional.createDataAnalystRole();
await reportingFunctional.createDataAnalyst();
await reportingFunctional.createTestReportingUserRole();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import { FtrProviderContext } from '../ftr_provider_context';
export default function ({ loadTestFile, getService }: FtrProviderContext) {
describe('Reporting Functional Tests with Security disabled', function () {
this.tags('ciGroup2');

before(async () => {
const reportingAPI = getService('reportingAPI');
await reportingAPI.checkTaskManagerHealth();
});

loadTestFile(require.resolve('./management'));
});
}