Skip to content

Commit c43f83d

Browse files
eyalkorenbreskeby
andauthored
[CI] Adding continuous testing for ECS dynamic templates (#97901)
* Enforcing formatting * Add proper reporting and assertions * Verify ECS multi-field mappings * Test flattened field mappings * Add ecs dynamic template build job * Setup notifications for failing ecs template tests --------- Co-authored-by: Rene Groeschke <rene@elastic.co>
1 parent 9f12658 commit c43f83d

File tree

4 files changed

+439
-20
lines changed

4 files changed

+439
-20
lines changed

.buildkite/pipelines/ecs-dynamic-template-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ steps:
77
image: family/elasticsearch-ubuntu-2004
88
diskSizeGb: 350
99
machineType: custom-32-98304
10+
notify:
11+
- slack: "#es-delivery"
12+
if: build.state == "failed"
13+
- email: "logs-plus@elastic.co"
14+
if: build.state == "failed"

x-pack/plugin/core/template-resources/src/main/resources/ecs-dynamic-mappings.json

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,6 @@
8383
},
8484
{
8585
"ecs_path_match_keyword_and_match_only_text": {
86-
"mapping": {
87-
"fields": {
88-
"text": {
89-
"type": "match_only_text"
90-
}
91-
},
92-
"type": "keyword"
93-
},
94-
"path_match": [
95-
"*file.path",
96-
"*file.target_path",
97-
"*os.full",
98-
"user_agent.original"
99-
]
100-
}
101-
},
102-
{
103-
"ecs_match_keyword_and_match_only_text": {
10486
"mapping": {
10587
"fields": {
10688
"text": {
@@ -114,7 +96,13 @@
11496
"*.executable",
11597
"*.name",
11698
"*.working_directory",
117-
"*.full_name"
99+
"*.full_name",
100+
"*file.path",
101+
"*file.target_path",
102+
"*os.full",
103+
"email.subject",
104+
"vulnerability.description",
105+
"user_agent.original"
118106
]
119107
}
120108
},

x-pack/plugin/stack/build.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'elasticsearch.internal-es-plugin'
2+
apply plugin: 'elasticsearch.internal-java-rest-test'
23

34
esplugin {
45
name 'x-pack-stack'
@@ -8,13 +9,25 @@ esplugin {
89
hasNativeController false
910
requiresKeystore true
1011
}
12+
1113
base {
1214
archivesName = 'x-pack-stack'
1315
}
1416

1517
dependencies {
1618
compileOnly project(path: xpackModule('core'))
17-
testImplementation(testArtifact(project(xpackModule('core'))))
19+
javaRestTestImplementation(testArtifact(project(xpackModule('core'))))
20+
javaRestTestImplementation project(path: ':x-pack:plugin:stack')
21+
clusterModules project(':modules:mapper-extras')
22+
clusterModules project(xpackModule('wildcard'))
23+
}
24+
25+
// These tests are only invoked direclty as part of a dedicated build job
26+
tasks.named('javaRestTest').configure {
27+
onlyIf("E2E test task must be invoked directly") {
28+
gradle.startParameter.getTaskNames().contains(this.path) ||
29+
(gradle.startParameter.getTaskNames().contains(this.name) && gradle.startParameter.currentDir == project.projectDir)
30+
}
1831
}
1932

2033
addQaCheckDependencies(project)

0 commit comments

Comments
 (0)