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] Re-enabled Chromium API tests #26789

Merged
merged 3 commits into from
Dec 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
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'])
],
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes won't really take effect with this PR, since there still are no functional tests enabled. But I think it's better to make this change in this PR because it's similar to another change, and we can check for consistency

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