Skip to content

Commit 9a3bcf8

Browse files
authored
Allow using custom tests (#766)
1 parent c576b7e commit 9a3bcf8

File tree

11 files changed

+56
-0
lines changed

11 files changed

+56
-0
lines changed

tests/templates/kuttl/cluster-operation/20-install-kafka.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: test-kafka
1010
spec:
1111
image:
12+
{% if test_scenario['values']['kafka-latest'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['kafka-latest'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['kafka-latest'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['kafka-latest'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
{% if lookup('env', 'VECTOR_AGGREGATOR') %}

tests/templates/kuttl/cluster-operation/30-stop-kafka.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: test-kafka
1010
spec:
1111
image:
12+
{% if test_scenario['values']['kafka-latest'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['kafka-latest'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['kafka-latest'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['kafka-latest'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
{% if lookup('env', 'VECTOR_AGGREGATOR') %}

tests/templates/kuttl/cluster-operation/40-pause-kafka.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: test-kafka
1010
spec:
1111
image:
12+
{% if test_scenario['values']['kafka-latest'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['kafka-latest'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['kafka-latest'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['kafka-latest'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
{% if lookup('env', 'VECTOR_AGGREGATOR') %}

tests/templates/kuttl/cluster-operation/50-restart-kafka.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: test-kafka
1010
spec:
1111
image:
12+
{% if test_scenario['values']['kafka-latest'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['kafka-latest'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['kafka-latest'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['kafka-latest'] }}"
17+
{% endif %}
1318
clusterConfig:
1419
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
1520
vectorAggregatorConfigMapName: vector-aggregator-discovery

tests/templates/kuttl/configuration/20-install-kafka.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: test-kafka
1010
spec:
1111
image:
12+
{% if test_scenario['values']['kafka-latest'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['kafka-latest'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['kafka-latest'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['kafka-latest'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
{% if lookup('env', 'VECTOR_AGGREGATOR') %}

tests/templates/kuttl/delete-rolegroup/02-install-kafka.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: test-kafka
1010
spec:
1111
image:
12+
{% if test_scenario['values']['kafka'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['kafka'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['kafka'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['kafka'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
{% if lookup('env', 'VECTOR_AGGREGATOR') %}

tests/templates/kuttl/delete-rolegroup/03-delete-secondary.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: test-kafka
1010
spec:
1111
image:
12+
{% if test_scenario['values']['kafka'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['kafka'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['kafka'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['kafka'] }}"
17+
{% endif %}
1318
clusterConfig:
1419
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
1520
vectorAggregatorConfigMapName: vector-aggregator-discovery

tests/templates/kuttl/logging/04-install-kafka.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ metadata:
2525
name: test-kafka
2626
spec:
2727
image:
28+
{% if test_scenario['values']['kafka'].find(",") > 0 %}
29+
custom: "{{ test_scenario['values']['kafka'].split(',')[1] }}"
30+
productVersion: "{{ test_scenario['values']['kafka'].split(',')[0] }}"
31+
{% else %}
2832
productVersion: "{{ test_scenario['values']['kafka'] }}"
33+
{% endif %}
2934
pullPolicy: IfNotPresent
3035
clusterConfig:
3136
tls:

tests/templates/kuttl/smoke/30-install-kafka.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ metadata:
99
name: test-kafka
1010
spec:
1111
image:
12+
{% if test_scenario['values']['kafka'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['kafka'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['kafka'].split(',')[0] }}"
15+
{% else %}
1216
productVersion: "{{ test_scenario['values']['kafka'] }}"
17+
{% endif %}
1318
pullPolicy: IfNotPresent
1419
clusterConfig:
1520
tls:

tests/templates/kuttl/tls/20-install-kafka.yaml.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ metadata:
3737
name: test-kafka
3838
spec:
3939
image:
40+
{% if test_scenario['values']['kafka'].find(",") > 0 %}
41+
custom: "{{ test_scenario['values']['kafka'].split(',')[1] }}"
42+
productVersion: "{{ test_scenario['values']['kafka'].split(',')[0] }}"
43+
{% else %}
4044
productVersion: "{{ test_scenario['values']['kafka'] }}"
45+
{% endif %}
4146
pullPolicy: IfNotPresent
4247
clusterConfig:
4348
{% if test_scenario['values']['use-client-auth-tls'] == 'true' %}

0 commit comments

Comments
 (0)