Skip to content

Commit

Permalink
Merge branch 'master' into tech-debt/recompose-toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Jul 29, 2020
2 parents 6f35db0 + 0756dd3 commit 3a087c6
Show file tree
Hide file tree
Showing 1,145 changed files with 23,963 additions and 18,861 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
18 changes: 0 additions & 18 deletions docs/apm/error-reports-watcher.asciidoc

This file was deleted.

3 changes: 0 additions & 3 deletions docs/apm/how-to-guides.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Learn how to perform common APM app tasks.
* <<agent-configuration>>
* <<apm-alerts>>
* <<custom-links>>
* <<errors-alerts-with-watcher>>
* <<filters>>
* <<machine-learning-integration>>
* <<advanced-queries>>
Expand All @@ -21,8 +20,6 @@ include::apm-alerts.asciidoc[]

include::custom-links.asciidoc[]

include::error-reports-watcher.asciidoc[]

include::filters.asciidoc[]

include::machine-learning.asciidoc[]
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;
```
Loading

0 comments on commit 3a087c6

Please sign in to comment.