Skip to content

Commit 3e48996

Browse files
authored
Add deployer setting to system test configuration (#1104)
Add the validation of the deployer setting into the system test configuration file spec, as it was done for the benchmark system configuration files.
1 parent fd2349d commit 3e48996

18 files changed

Lines changed: 486 additions & 8 deletions

File tree

code/go/pkg/validator/validator_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,12 @@ func TestValidateFile(t *testing.T) {
517517
"field deployer: deployer must be one of the following: \"docker\", \"tf\", \"k8s\"",
518518
},
519519
},
520+
"bad_deployer_system_test": {
521+
"data_stream/foo/_dev/test/system/test-default-config.yml",
522+
[]string{
523+
"field deployer: deployer must be one of the following: \"docker\", \"tf\", \"k8s\"",
524+
},
525+
},
520526
}
521527

522528
for pkgName, test := range tests {

spec/changelog.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
- description: Add support for `profiles` policy template type in input packages
6565
type: enhancement
6666
link: https://github.com/elastic/package-spec/pull/1092
67+
- description: Add deployer option to system test configuration.
68+
type: enhancement
69+
link: https://github.com/elastic/package-spec/pull/1104
6770
- version: 3.5.7
6871
changes:
6972
- description: Allow _dev directory for content-only packages; use _dev/shared for development files (e.g. dashboard YML sources).

spec/integration/_dev/benchmark/system.scenario.spec.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ spec:
4949
type: string
5050
default: 10m
5151
example: 10m
52-
deployer:
53-
description: Name of the service deployer to setup for this system benchmark.
54-
type: string
55-
enum:
56-
- docker
57-
- tf
58-
- k8s
5952
corpora:
6053
description: Corpora settings.
6154
type: object
@@ -161,6 +154,6 @@ spec:
161154
wait_for_data_timeout:
162155
$ref: "#/definitions/wait_for_data_timeout"
163156
deployer:
164-
$ref: "#/definitions/deployer"
157+
$ref: "../../data_stream/_dev/test/config.spec.yml#/definitions/deployer"
165158
corpora:
166159
$ref: "#/definitions/corpora"

spec/integration/data_stream/_dev/test/config.spec.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ spec:
66
type: object
77
additionalProperties: false
88
definitions:
9+
deployer:
10+
description: Name of the service deployer to setup for this system benchmark.
11+
type: string
12+
enum:
13+
- docker
14+
- tf
15+
- k8s
916
skip:
1017
description: If this test should be skipped, more information about why it was skipped.
1118
type: object

spec/integration/data_stream/_dev/test/system/config.spec.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ spec:
55
# Everything under here follows JSON schema (https://json-schema.org/), written as YAML for readability
66
type: object
77
properties:
8+
deployer:
9+
$ref: "./../config.spec.yml#/definitions/deployer"
810
skip:
911
$ref: "./../config.spec.yml#/definitions/skip"
1012
wait_for_data_timeout:
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Elastic License 2.0
2+
3+
URL: https://www.elastic.co/licensing/elastic-license
4+
5+
## Acceptance
6+
7+
By using the software, you agree to all of the terms and conditions below.
8+
9+
## Copyright License
10+
11+
The licensor grants you a non-exclusive, royalty-free, worldwide,
12+
non-sublicensable, non-transferable license to use, copy, distribute, make
13+
available, and prepare derivative works of the software, in each case subject to
14+
the limitations and conditions below.
15+
16+
## Limitations
17+
18+
You may not provide the software to third parties as a hosted or managed
19+
service, where the service provides users with access to any substantial set of
20+
the features or functionality of the software.
21+
22+
You may not move, change, disable, or circumvent the license key functionality
23+
in the software, and you may not remove or obscure any functionality in the
24+
software that is protected by the license key.
25+
26+
You may not alter, remove, or obscure any licensing, copyright, or other notices
27+
of the licensor in the software. Any use of the licensor’s trademarks is subject
28+
to applicable law.
29+
30+
## Patents
31+
32+
The licensor grants you a license, under any patent claims the licensor can
33+
license, or becomes able to license, to make, have made, use, sell, offer for
34+
sale, import and have imported the software, in each case subject to the
35+
limitations and conditions in this license. This license does not cover any
36+
patent claims that you cause to be infringed by modifications or additions to
37+
the software. If you or your company make any written claim that the software
38+
infringes or contributes to infringement of any patent, your patent license for
39+
the software granted under these terms ends immediately. If your company makes
40+
such a claim, your patent license ends immediately for work on behalf of your
41+
company.
42+
43+
## Notices
44+
45+
You must ensure that anyone who gets a copy of any part of the software from you
46+
also gets a copy of these terms.
47+
48+
If you modify the software, you must include in any modified copies of the
49+
software prominent notices stating that you have modified the software.
50+
51+
## No Other Rights
52+
53+
These terms do not imply any licenses other than those expressly granted in
54+
these terms.
55+
56+
## Termination
57+
58+
If you use the software in violation of these terms, such use is not licensed,
59+
and your licenses will automatically terminate. If the licensor provides you
60+
with a notice of your violation, and you cease all violation of this license no
61+
later than 30 days after you receive that notice, your licenses will be
62+
reinstated retroactively. However, if you violate these terms after such
63+
reinstatement, any additional violation of these terms will cause your licenses
64+
to terminate automatically and permanently.
65+
66+
## No Liability
67+
68+
*As far as the law allows, the software comes as is, without any warranty or
69+
condition, and the licensor will not be liable to you for any damages arising
70+
out of these terms or the use or nature of the software, under any kind of
71+
legal claim.*
72+
73+
## Definitions
74+
75+
The **licensor** is the entity offering these terms, and the **software** is the
76+
software the licensor makes available under these terms, including any portion
77+
of it.
78+
79+
**you** refers to the individual or entity agreeing to these terms.
80+
81+
**your company** is any legal entity, sole proprietorship, or other kind of
82+
organization that you work for, plus all organizations that have control over,
83+
are under the control of, or are under common control with that
84+
organization. **control** means ownership of substantially all the assets of an
85+
entity, or the power to direct its management and policies by vote, contract, or
86+
otherwise. Control can be direct or indirect.
87+
88+
**your licenses** are all the licenses granted to you for the software under
89+
these terms.
90+
91+
**use** means anything you do with the software requiring one of your licenses.
92+
93+
**trademark** means trademarks, service marks, and similar rights.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# newer versions go on top
2+
- version: "0.0.1"
3+
changes:
4+
- description: Initial draft of the package
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/1 # FIXME Replace with the real PR link
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
deployer: invaliddeployer
2+
vars: ~
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
paths:
2+
{{#each paths as |path|}}
3+
- {{path}}
4+
{{/each}}
5+
{{#if exclude_files}}
6+
prospector.scanner.exclude_files:
7+
{{#each exclude_files as |pattern f|}}
8+
- {{pattern}}
9+
{{/each}}
10+
{{/if}}
11+
{{#if multiline_json}}
12+
multiline.pattern: '^{'
13+
multiline.negate: true
14+
multiline.match: after
15+
multiline.max_lines: 5000
16+
multiline.timeout: 10
17+
{{/if}}
18+
{{#if custom}}
19+
{{custom}}
20+
{{/if}}
21+
22+
{{#if tags.length}}
23+
tags:
24+
{{#each tags as |tag|}}
25+
- {{tag}}
26+
{{/each}}
27+
{{#if preserve_original_event}}
28+
- preserve_original_event
29+
{{/if}}
30+
{{else}}
31+
{{#if preserve_original_event}}
32+
tags:
33+
- preserve_original_event
34+
{{/if}}
35+
36+
{{#contains "forwarded" tags}}
37+
publisher_pipeline.disable_host: true
38+
{{/contains}}
39+
40+
{{#if processors}}
41+
processors:
42+
{{processors}}
43+
{{/if}}
44+
{{/if}}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description: Pipeline for processing sample logs
3+
processors:
4+
- set:
5+
field: sample_field
6+
value: "1"
7+
on_failure:
8+
- set:
9+
field: error.message
10+
value: '{{ _ingest.on_failure_message }}'

0 commit comments

Comments
 (0)