Skip to content

Commit

Permalink
[Reporting] Re-enabled Chromium API tests (#26789)
Browse files Browse the repository at this point in the history
* [Reporting] Test logging

* chromium api tests fixed

* whitespace
  • Loading branch information
tsullivan authored and chrisronline committed Dec 12, 2018
1 parent 9240b8d commit e32c203
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
10 changes: 10 additions & 0 deletions x-pack/plugins/reporting/server/routes/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ export function jobs(server) {
const { docId } = request.params;

let response = await jobResponseHandler(request.pre.management.jobTypes, request.pre.user, h, { docId });
const { statusCode } = response;

if (statusCode !== 200) {
const logLevel = statusCode === 500 ? 'error' : 'debug';
server.log(
[logLevel, "reporting", "download"],
`Report ${docId} has non-OK status: [${statusCode}] Reason: [${JSON.stringify(response.source)}]`
);
}

if (!response.isBoom) {
response = response.header('accept-ranges', 'none');
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/scripts/functional_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

require('@kbn/plugin-helpers').babelRegister();
require('@kbn/test').runTestsCli([
// require.resolve('../test/reporting/configs/chromium_api.js'),
require.resolve('../test/reporting/configs/chromium_api.js'),
// require.resolve('../test/reporting/configs/chromium_functional.js'),
// require.resolve('../test/reporting/configs/phantom_api.js'),
// require.resolve('../test/reporting/configs/phantom_functional.js'),
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/reporting/configs/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export async function getReportingApiConfig({ readConfigFile }) {
serverArgs: [
...apiConfig.get('kbnTestServer.serverArgs'),
`--optimize.enabled=true`,
'--logging.events.log', JSON.stringify(['info', 'warning', 'error', 'fatal', 'optimize', 'reporting'])
],
},
};
Expand Down
1 change: 0 additions & 1 deletion x-pack/test/reporting/configs/chromium_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default async function ({ readConfigFile }) {
...reportingApiConfig.kbnTestServer.serverArgs,
`--xpack.reporting.capture.browser.type=chromium`,
`--xpack.spaces.enabled=false`,
`--logging.verbose=true`,
],
},
};
Expand Down
10 changes: 8 additions & 2 deletions x-pack/test/reporting/configs/functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ export async function getFunctionalConfig({ readConfigFile }) {
junit: {
reportName: 'X-Pack Reporting Functional Tests',
},
kbnTestServer: xPackFunctionalTestsConfig.get('kbnTestServer'),
kbnTestServer: {
...xPackFunctionalTestsConfig.get('kbnTestServer'),
serverArgs: [
...xPackFunctionalTestsConfig.get('kbnTestServer.serverArgs'),
'--logging.events.log', JSON.stringify(['info', 'warning', 'error', 'fatal', 'optimize', 'reporting'])
],
},
testFiles: [require.resolve('../functional')],
};
}

export default getFunctionalConfig;
export default getFunctionalConfig;
1 change: 0 additions & 1 deletion x-pack/test/reporting/configs/phantom_functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export default async function ({ readConfigFile }) {
serverArgs: [
...functionalConfig.kbnTestServer.serverArgs,
`--xpack.reporting.capture.browser.type=phantom`,
`--logging.verbose=true`,
],
},
};
Expand Down

0 comments on commit e32c203

Please sign in to comment.