Skip to content

Commit

Permalink
[Uptime Monitor management] Update test configs (#125358)
Browse files Browse the repository at this point in the history
(cherry picked from commit 13d566c)
  • Loading branch information
shahzad31 committed Feb 15, 2022
1 parent 7ac926d commit 63dd366
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
22 changes: 22 additions & 0 deletions x-pack/plugins/uptime/e2e/tasks/read_kibana_config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import path from 'path';
import fs from 'fs';
import yaml from 'js-yaml';

export type KibanaConfig = ReturnType<typeof readKibanaConfig>;

export const readKibanaConfig = () => {
const kibanaConfigDir = path.join(__filename, '../../../../../../config');
const kibanaDevConfig = path.join(kibanaConfigDir, 'kibana.dev.yml');
const kibanaConfig = path.join(kibanaConfigDir, 'kibana.yml');

return (yaml.safeLoad(
fs.readFileSync(fs.existsSync(kibanaDevConfig) ? kibanaDevConfig : kibanaConfig, 'utf8')
) || {}) as Record<string, string>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { UptimeServerSetup } from '../adapters/framework';
export async function getServiceLocations(server: UptimeServerSetup) {
const locations: ServiceLocations = [];

if (!server.config.service!.manifestUrl!) {
if (!server.config.service?.manifestUrl) {
return { locations };
}

Expand Down
1 change: 0 additions & 1 deletion x-pack/test/api_integration/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export async function getApiIntegrationConfig({ readConfigFile }: FtrConfigProvi
'--xpack.ruleRegistry.write.cache.enabled=false',
'--xpack.uptime.service.enabled=true',
'--xpack.uptime.service.password=test',
'--xpack.uptime.service.manifestUrl=http://test.com',
'--xpack.uptime.service.username=localKibanaIntegrationTestsUser',
`--xpack.securitySolution.enableExperimental=${JSON.stringify(['ruleRegistryEnabled'])}`,
],
Expand Down

0 comments on commit 63dd366

Please sign in to comment.