Skip to content

Commit 0e40685

Browse files
Merge branch 'master' into 66388-fix-get-missing-package-config
2 parents f6b3876 + 01b70dd commit 0e40685

File tree

410 files changed

+11912
-9143
lines changed

Some content is hidden

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

410 files changed

+11912
-9143
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
},
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+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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)
4+
5+
## CountResponse interface
6+
7+
8+
<b>Signature:</b>
9+
10+
```typescript
11+
export interface CountResponse
12+
```
13+
14+
## Properties
15+
16+
| Property | Type | Description |
17+
| --- | --- | --- |
18+
| [\_shards](./kibana-plugin-core-server.countresponse._shards.md) | <code>ShardsInfo</code> | |
19+
| [count](./kibana-plugin-core-server.countresponse.count.md) | <code>number</code> | |
20+
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; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_id](./kibana-plugin-core-server.deletedocumentresponse._id.md)
4+
5+
## DeleteDocumentResponse.\_id property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
_id: string;
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; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_index](./kibana-plugin-core-server.deletedocumentresponse._index.md)
4+
5+
## DeleteDocumentResponse.\_index property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
_index: string;
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; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_shards](./kibana-plugin-core-server.deletedocumentresponse._shards.md)
4+
5+
## DeleteDocumentResponse.\_shards property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
_shards: ShardsResponse;
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; [DeleteDocumentResponse](./kibana-plugin-core-server.deletedocumentresponse.md) &gt; [\_type](./kibana-plugin-core-server.deletedocumentresponse._type.md)
4+
5+
## DeleteDocumentResponse.\_type property
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
_type: string;
11+
```

0 commit comments

Comments
 (0)