Skip to content

Commit

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

* [Reporting] Test logging

* chromium api tests fixed

* whitespace

* back out accidental removals
  • Loading branch information
tsullivan authored Dec 7, 2018
1 parent 52bb105 commit b4036ae
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 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
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 b4036ae

Please sign in to comment.