-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Uptime Monitor management] Update test configs (#125358)
(cherry picked from commit 13d566c)
- Loading branch information
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters