Skip to content

Commit 4c65074

Browse files
Merge branch 'master' into 73698-nometric-expression-fix
2 parents aaf59b7 + b4aa750 commit 4c65074

File tree

871 files changed

+20135
-16765
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

871 files changed

+20135
-16765
lines changed

.ci/pipeline-library/src/test/KibanaBasePipelineTest.groovy

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ class KibanaBasePipelineTest extends BasePipelineTest {
7878
return helper.callStack.find { it.methodName == name }
7979
}
8080

81+
def fnMocks(String name) {
82+
helper.callStack.findAll { it.methodName == name }
83+
}
84+
8185
void mockFailureBuild() {
8286
props([
8387
buildUtils: [

.ci/pipeline-library/src/test/slackNotifications.groovy

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,67 @@ class SlackNotificationsTest extends KibanaBasePipelineTest {
5959
args.blocks[2].text.text.toString()
6060
)
6161
}
62+
63+
@Test
64+
void 'sendFailedBuild() should call slackSend() with a backup message when first attempt fails'() {
65+
mockFailureBuild()
66+
def counter = 0
67+
helper.registerAllowedMethod('slackSend', [Map.class], { ++counter > 1 })
68+
slackNotifications.sendFailedBuild()
69+
70+
def args = fnMocks('slackSend')[1].args[0]
71+
72+
def expected = [
73+
channel: '#kibana-operations-alerts',
74+
username: 'Kibana Operations',
75+
iconEmoji: ':jenkins:',
76+
color: 'danger',
77+
message: ':broken_heart: elastic / kibana # master #1',
78+
]
79+
80+
expected.each {
81+
assertEquals(it.value.toString(), args[it.key].toString())
82+
}
83+
84+
assertEquals(
85+
":broken_heart: *<http://jenkins.localhost:8080/job/elastic+kibana+master/1/|elastic / kibana # master #1>*" +
86+
"\n\nFirst attempt at sending this notification failed. Please check the build.",
87+
args.blocks[0].text.text.toString()
88+
)
89+
}
90+
91+
@Test
92+
void 'getTestFailures() should truncate list of failures to 10'() {
93+
prop('testUtils', [
94+
getFailures: {
95+
return (1..12).collect {
96+
return [
97+
url: Mocks.TEST_FAILURE_URL,
98+
fullDisplayName: "Failure #${it}",
99+
]
100+
}
101+
},
102+
])
103+
104+
def message = (String) slackNotifications.getTestFailures()
105+
106+
assertTrue("Message ends with truncated indicator", message.endsWith("...and 2 more"))
107+
assertTrue("Message contains Failure #10", message.contains("Failure #10"))
108+
assertTrue("Message does not contain Failure #11", !message.contains("Failure #11"))
109+
}
110+
111+
@Test
112+
void 'shortenMessage() should truncate a long message, but leave parts that fit'() {
113+
assertEquals('Hello\nHello\n[...truncated...]', slackNotifications.shortenMessage('Hello\nHello\nthis is a long string', 29))
114+
}
115+
116+
@Test
117+
void 'shortenMessage() should not modify a short message'() {
118+
assertEquals('Hello world', slackNotifications.shortenMessage('Hello world', 11))
119+
}
120+
121+
@Test
122+
void 'shortenMessage() should truncate an entire message with only one part'() {
123+
assertEquals('[...truncated...]', slackNotifications.shortenMessage('Hello world this is a really long message', 40))
124+
}
62125
}

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ kibanaPipeline(timeoutMinutes: 155, checkPrChanges: true, setCommitStatus: true)
4343
'xpack-accessibility': kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'),
4444
'xpack-savedObjectsFieldMetrics': kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'),
4545
'xpack-securitySolutionCypress': { processNumber ->
46-
whenChanged(['x-pack/plugins/security_solution/', 'x-pack/test/security_solution_cypress/']) {
46+
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']) {
4747
kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypress', './test/scripts/jenkins_security_solution_cypress.sh')(processNumber)
4848
}
4949
},

docs/apm/error-reports-watcher.asciidoc

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/apm/how-to-guides.asciidoc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Learn how to perform common APM app tasks.
88
* <<agent-configuration>>
99
* <<apm-alerts>>
1010
* <<custom-links>>
11-
* <<errors-alerts-with-watcher>>
1211
* <<filters>>
1312
* <<machine-learning-integration>>
1413
* <<advanced-queries>>
@@ -21,8 +20,6 @@ include::apm-alerts.asciidoc[]
2120

2221
include::custom-links.asciidoc[]
2322

24-
include::error-reports-watcher.asciidoc[]
25-
2623
include::filters.asciidoc[]
2724

2825
include::machine-learning.asciidoc[]

docs/developer/architecture/code-exploration.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,9 @@ WARNING: Missing README.
524524
See Configuring security in Kibana.
525525
526526
527-
- {kib-repo}blob/{branch}/x-pack/plugins/security_solution[securitySolution]
527+
- {kib-repo}blob/{branch}/x-pack/plugins/security_solution/README.md[securitySolution]
528528
529-
WARNING: Missing README.
529+
Welcome to the Kibana Security Solution plugin! This README will go over getting started with development and testing.
530530
531531
532532
- {kib-repo}blob/{branch}/x-pack/plugins/snapshot_restore/README.md[snapshotRestore]

docs/developer/contributing/development-tests.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ root)
2626
|Functional
2727
|`test/*integration/**/config.js` `test/*functional/**/config.js` `test/accessibility/config.js`
2828
|`yarn test:ftr:server --config test/[directory]/config.js``yarn test:ftr:runner --config test/[directory]/config.js --grep=regexp`
29-
30-
|Karma |`src/**/public/__tests__/*.js` |`yarn test:karma:debug`
3129
|===
3230

3331
For X-Pack tests located in `x-pack/` see

docs/developer/contributing/development-unit-tests.asciidoc

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -95,38 +95,6 @@ to proceed in this mode.
9595
node scripts/mocha --debug <file>
9696
----
9797

98-
With `yarn test:karma`, you can run only the browser tests. Coverage
99-
reports are available for browser tests by running
100-
`yarn test:coverage`. You can find the results under the `coverage/`
101-
directory that will be created upon completion.
102-
103-
[source,bash]
104-
----
105-
yarn test:karma
106-
----
107-
108-
Using `yarn test:karma:debug` initializes an environment for debugging
109-
the browser tests. Includes an dedicated instance of the {kib} server
110-
for building the test bundle, and a karma server. When running this task
111-
the build is optimized for the first time and then a karma-owned
112-
instance of the browser is opened. Click the "`debug`" button to open a
113-
new tab that executes the unit tests.
114-
115-
[source,bash]
116-
----
117-
yarn test:karma:debug
118-
----
119-
120-
In the screenshot below, you’ll notice the URL is
121-
`localhost:9876/debug.html`. You can append a `grep` query parameter
122-
to this URL and set it to a string value which will be used to exclude
123-
tests which don’t match. For example, if you changed the URL to
124-
`localhost:9876/debug.html?query=my test` and then refreshed the
125-
browser, you’d only see tests run which contain "`my test`" in the test
126-
description.
127-
128-
image:http://i.imgur.com/DwHxgfq.png[Browser test debugging]
129-
13098
[discrete]
13199
=== Unit Testing Plugins
132100

@@ -141,5 +109,4 @@ command from your plugin:
141109
[source,bash]
142110
----
143111
yarn test:mocha
144-
yarn test:karma:debug # remove the debug flag to run them once and close
145112
----
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[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)
4+
5+
## CountResponse.\_shards property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
_shards: ShardsInfo;
11+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[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)
4+
5+
## CountResponse.count property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
count: number;
11+
```

0 commit comments

Comments
 (0)