Skip to content

Commit

Permalink
Merge branch 'master' into task-manager/fix-flaky-test
Browse files Browse the repository at this point in the history
* master: (126 commits)
  [ML] Disabling ML if license feature is disabled (elastic#73187)
  [ML] Fixing old _xpack style es endpoint paths (elastic#73667)
  [DOCS] [Lens] 7.9 docs refresh (elastic#72301)
  [ML] DF Analytics results: ensure `View` link is only enabled when job has successfully completed (elastic#73539)
  Set timeRange to default to trigger the error message (elastic#73629)
  [ML] Functional tests - stabilize DFA navigation and index pattern handling (elastic#73660)
  [ILM] Add links to "Snapshot and Restore" from ILM "wait for snapshot policy" (elastic#72473)
  [kbn-storybook] Update Storybook to 5.3.19 (elastic#73320)
  [Metrics UI] Fix hasData call to ensure it has data not just indices (elastic#72969)
  [Uptime] Use `service.name` to link from Uptime -> APM where available (elastic#73618)
  allow others to update `URL.revokeObjectURL` property if needed (elastic#73639)
  regen docs (elastic#73650)
  [Visualize] Fix inspector download filename issue when saving in-place (elastic#72605)
  [Data] Query Input String manager (elastic#72093)
  [Security Solutions] Add tooltips (elastic#73436)
  Do not render descriptionless actions within an EuiCard (elastic#73611)
  [Security Solution][Detections] Value Lists Modal supports multiple exports (elastic#73532)
  [Security Solution][Resolver] Handle disabled process collection (elastic#73592)
  [Security_Solution][Bug] Fix user name/domain to ECS structure (elastic#73530)
  [Security Solution][Exceptions] - Update rule.exceptions_list to include exception list list_id (elastic#73349)
  ...
  • Loading branch information
gmmorris committed Jul 29, 2020
2 parents af3d139 + 10cbaf5 commit 8764243
Show file tree
Hide file tree
Showing 1,065 changed files with 22,333 additions and 17,959 deletions.
4 changes: 4 additions & 0 deletions .ci/pipeline-library/src/test/KibanaBasePipelineTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class KibanaBasePipelineTest extends BasePipelineTest {
return helper.callStack.find { it.methodName == name }
}

def fnMocks(String name) {
helper.callStack.findAll { it.methodName == name }
}

void mockFailureBuild() {
props([
buildUtils: [
Expand Down
63 changes: 63 additions & 0 deletions .ci/pipeline-library/src/test/slackNotifications.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,67 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
args.blocks[2].text.text.toString()
)
}

@Test
void 'sendFailedBuild() should call slackSend() with a backup message when first attempt fails'() {
mockFailureBuild()
def counter = 0
helper.registerAllowedMethod('slackSend', [Map.class], { ++counter > 1 })
slackNotifications.sendFailedBuild()

def args = fnMocks('slackSend')[1].args[0]

def expected = [
channel: '#kibana-operations-alerts',
username: 'Kibana Operations',
iconEmoji: ':jenkins:',
color: 'danger',
message: ':broken_heart: elastic / kibana # master #1',
]

expected.each {
assertEquals(it.value.toString(), args[it.key].toString())
}

assertEquals(
":broken_heart: *<http://jenkins.localhost:8080/job/elastic+kibana+master/1/|elastic / kibana # master #1>*" +
"\n\nFirst attempt at sending this notification failed. Please check the build.",
args.blocks[0].text.text.toString()
)
}

@Test
void 'getTestFailures() should truncate list of failures to 10'() {
prop('testUtils', [
getFailures: {
return (1..12).collect {
return [
url: Mocks.TEST_FAILURE_URL,
fullDisplayName: "Failure #${it}",
]
}
},
])

def message = (String) slackNotifications.getTestFailures()

assertTrue("Message ends with truncated indicator", message.endsWith("...and 2 more"))
assertTrue("Message contains Failure #10", message.contains("Failure #10"))
assertTrue("Message does not contain Failure #11", !message.contains("Failure #11"))
}

@Test
void 'shortenMessage() should truncate a long message, but leave parts that fit'() {
assertEquals('Hello\nHello\n[...truncated...]', slackNotifications.shortenMessage('Hello\nHello\nthis is a long string', 29))
}

@Test
void 'shortenMessage() should not modify a short message'() {
assertEquals('Hello world', slackNotifications.shortenMessage('Hello world', 11))
}

@Test
void 'shortenMessage() should truncate an entire message with only one part'() {
assertEquals('[...truncated...]', slackNotifications.shortenMessage('Hello world this is a really long message', 40))
}
}
21 changes: 12 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,19 +771,22 @@ module.exports = {
},

/**
* APM overrides
* APM and Observability overrides
*/
{
files: ['x-pack/plugins/apm/**/*.js'],
files: [
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
],
rules: {
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-console': ['warn', { allow: ['error'] }],
},
},
{
plugins: ['react-hooks'],
files: ['x-pack/plugins/apm/**/*.{ts,tsx}'],
rules: {
'react/function-component-definition': [
'warn',
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': ['error', { additionalHooks: '^useFetcher$' }],
},
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true)
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
'xpack-securitySolutionCypress': { processNumber ->
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/']) {
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/', 'x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/', 'x-pack/plugins/triggers_actions_ui/public/application/context/actions_connectors_context.tsx']) {
kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber)
}
},
Expand Down
4 changes: 2 additions & 2 deletions docs/developer/architecture/code-exploration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,9 @@ WARNING: Missing README.
See Configuring security in Kibana.
- {kib-repo}blob/{branch}/x-pack/plugins/security_solution[securitySolution]
- {kib-repo}blob/{branch}/x-pack/plugins/security_solution/README.md[securitySolution]
WARNING: Missing README.
Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing.
- {kib-repo}blob/{branch}/x-pack/plugins/snapshot_restore/README.md[snapshotRestore]
Expand Down
2 changes: 0 additions & 2 deletions docs/developer/contributing/development-tests.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ root)
|Functional
|`test/*integration/**/config.js` `test/*functional/**/config.js` `test/accessibility/config.js`
|`yarn test:ftr:server --config test/[directory]/config.js``yarn test:ftr:runner --config test/[directory]/config.js --grep=regexp`

|Karma |`src/**/public/__tests__/*.js` |`yarn test:karma:debug`
|===

For X-Pack tests located in `x-pack/` see
Expand Down
33 changes: 0 additions & 33 deletions docs/developer/contributing/development-unit-tests.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,38 +95,6 @@ to proceed in this mode.
node scripts/mocha --debug <file>
----

With `yarn test:karma`, you can run only the browser tests. Coverage
reports are available for browser tests by running
`yarn test:coverage`. You can find the results under the `coverage/`
directory that will be created upon completion.

[source,bash]
----
yarn test:karma
----

Using `yarn test:karma:debug` initializes an environment for debugging
the browser tests. Includes an dedicated instance of the {kib} server
for building the test bundle, and a karma server. When running this task
the build is optimized for the first time and then a karma-owned
instance of the browser is opened. Click the "`debug`" button to open a
new tab that executes the unit tests.

[source,bash]
----
yarn test:karma:debug
----

In the screenshot below, you’ll notice the URL is
`localhost:9876/debug.html`. You can append a `grep` query parameter
to this URL and set it to a string value which will be used to exclude
tests which don’t match. For example, if you changed the URL to
`localhost:9876/debug.html?query=my test` and then refreshed the
browser, you’d only see tests run which contain "`my test`" in the test
description.

image:http://i.imgur.com/DwHxgfq.png[Browser test debugging]

[discrete]
=== Unit Testing Plugins

Expand All @@ -141,5 +109,4 @@ command from your plugin:
[source,bash]
----
yarn test:mocha
yarn test:karma:debug # remove the debug flag to run them once and close
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CountResponse](./kibana-plugin-core-server.countresponse.md) &gt; [\_shards](./kibana-plugin-core-server.countresponse._shards.md)

## CountResponse.\_shards property

<b>Signature:</b>

```typescript
_shards: ShardsInfo;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CountResponse](./kibana-plugin-core-server.countresponse.md) &gt; [count](./kibana-plugin-core-server.countresponse.count.md)

## CountResponse.count property

<b>Signature:</b>

```typescript
count: number;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [CountResponse](./kibana-plugin-core-server.countresponse.md)

## CountResponse interface


<b>Signature:</b>

```typescript
export interface CountResponse
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [\_shards](./kibana-plugin-core-server.countresponse._shards.md) | <code>ShardsInfo</code> | |
| [count](./kibana-plugin-core-server.countresponse.count.md) | <code>number</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_id](./kibana-plugin-core-server.deletedocumentresponse._id.md)

## DeleteDocumentResponse.\_id property

<b>Signature:</b>

```typescript
_id: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_index](./kibana-plugin-core-server.deletedocumentresponse._index.md)

## DeleteDocumentResponse.\_index property

<b>Signature:</b>

```typescript
_index: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_shards](./kibana-plugin-core-server.deletedocumentresponse._shards.md)

## DeleteDocumentResponse.\_shards property

<b>Signature:</b>

```typescript
_shards: ShardsResponse;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_type](./kibana-plugin-core-server.deletedocumentresponse._type.md)

## DeleteDocumentResponse.\_type property

<b>Signature:</b>

```typescript
_type: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_version](./kibana-plugin-core-server.deletedocumentresponse._version.md)

## DeleteDocumentResponse.\_version property

<b>Signature:</b>

```typescript
_version: number;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [error](./kibana-plugin-core-server.deletedocumentresponse.error.md)

## DeleteDocumentResponse.error property

<b>Signature:</b>

```typescript
error?: {
type: string;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [found](./kibana-plugin-core-server.deletedocumentresponse.found.md)

## DeleteDocumentResponse.found property

<b>Signature:</b>

```typescript
found: boolean;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md)

## DeleteDocumentResponse interface


<b>Signature:</b>

```typescript
export interface DeleteDocumentResponse
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [\_id](./kibana-plugin-core-server.deletedocumentresponse._id.md) | <code>string</code> | |
| [\_index](./kibana-plugin-core-server.deletedocumentresponse._index.md) | <code>string</code> | |
| [\_shards](./kibana-plugin-core-server.deletedocumentresponse._shards.md) | <code>ShardsResponse</code> | |
| [\_type](./kibana-plugin-core-server.deletedocumentresponse._type.md) | <code>string</code> | |
| [\_version](./kibana-plugin-core-server.deletedocumentresponse._version.md) | <code>number</code> | |
| [error](./kibana-plugin-core-server.deletedocumentresponse.error.md) | <code>{</code><br/><code> type: string;</code><br/><code> }</code> | |
| [found](./kibana-plugin-core-server.deletedocumentresponse.found.md) | <code>boolean</code> | |
| [result](./kibana-plugin-core-server.deletedocumentresponse.result.md) | <code>string</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [result](./kibana-plugin-core-server.deletedocumentresponse.result.md)

## DeleteDocumentResponse.result property

<b>Signature:</b>

```typescript
result: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchClient](./kibana-plugin-core-server.elasticsearchclient.md)

## ElasticsearchClient type

Client used to query the elasticsearch cluster.

<b>Signature:</b>

```typescript
export declare type ElasticsearchClient = Omit<KibanaClient, 'connectionPool' | 'transport' | 'serializer' | 'extend' | 'child' | 'close'> & {
transport: {
request(params: TransportRequestParams, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse>;
};
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Explanation](./kibana-plugin-core-server.explanation.md) &gt; [description](./kibana-plugin-core-server.explanation.description.md)

## Explanation.description property

<b>Signature:</b>

```typescript
description: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [Explanation](./kibana-plugin-core-server.explanation.md) &gt; [details](./kibana-plugin-core-server.explanation.details.md)

## Explanation.details property

<b>Signature:</b>

```typescript
details: Explanation[];
```
Loading

0 comments on commit 8764243

Please sign in to comment.