Skip to content

Commit

Permalink
Simplify some tests and improve the reliability of others (#2389)
Browse files Browse the repository at this point in the history
* Release Jaeger Operator 1.52.0

Signed-off-by: Israel Blancas <[email protected]>

* Fix bundle

Signed-off-by: Israel Blancas <[email protected]>

* Simplify the tests related to the streaming strategy

Signed-off-by: Israel Blancas <[email protected]>

* Remove test. It doesn't bring real value

Signed-off-by: Israel Blancas <[email protected]>

* Simplify the daemonset tests

Signed-off-by: Israel Blancas <[email protected]>

* Fix field

Signed-off-by: Israel Blancas <[email protected]>

* Fix field

Signed-off-by: Israel Blancas <[email protected]>

* Fix field

Signed-off-by: Israel Blancas <[email protected]>

* Fix CI

Signed-off-by: Israel Blancas <[email protected]>

---------

Signed-off-by: Israel Blancas <[email protected]>
  • Loading branch information
iblancasa authored Dec 12, 2023
1 parent d4ab65e commit 4f201e6
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 158 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions tests/e2e/elasticsearch/render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,3 @@ else
-f $TEMPLATES_DIR/wait-for-cronjob-execution.yaml.template \
-o ./02-wait-spark-job.yaml
fi


###############################################################################
# TEST NAME: es-streaming-autoprovisioned
###############################################################################
if [[ $IS_OPENSHIFT = true && $SKIP_KAFKA = false ]]; then
start_test "es-streaming-autoprovisioned"
jaeger_name="auto-provisioned"

render_assert_kafka "true" "$jaeger_name" "00"
render_smoke_test "$jaeger_name" "true" "04"
else
skip_test "es-streaming-autoprovisioned" "This test is only supported in OpenShift with SKIP_KAFKA is false"
fi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
metadata:
name: agent-as-daemonset-agent-daemonset
status:
numberReady: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Add service account to user
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: "oc adm policy --namespace $NAMESPACE add-scc-to-user daemonset-with-hostport -z jaeger-agent-daemonset"
# Sometimes, the previous command needs some time to take effect. If we create
# the Jaeger deployment before the command takes effect, the Jaeger instance
# is not deployed. There is not a way to verify it is there except wait some
# seconds
- script: "sleep 5"

This file was deleted.

55 changes: 11 additions & 44 deletions tests/e2e/examples/render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@

source $(dirname "$0")/../render-utils.sh

###############################################################################
# TEST NAME: examples-agent-as-daemonset
###############################################################################
start_test "examples-agent-as-daemonset"
example_name="agent-as-daemonset"

prepare_daemonset "00"
render_install_example "$example_name" "01"
render_smoke_test_example "$example_name" "02"


###############################################################################
# TEST NAME: examples-agent-with-priority-class
###############################################################################
start_test "examples-agent-with-priority-class"
example_name="agent-with-priority-class"
prepare_daemonset "00"
render_install_example "$example_name" "01"
if [ $IS_OPENSHIFT != true ]; then
rm ./01-add-policy.yaml # This is just for OpenShift
fi
render_install_example "$example_name" "02"
render_smoke_test_example "$example_name" "02"


Expand All @@ -39,30 +31,6 @@ else
fi


###############################################################################
# TEST NAME: examples-auto-provision-kafka
###############################################################################
if [ $SKIP_KAFKA = true ]; then
skip_test "examples-auto-provision-kafka" "SKIP_KAFKA is true"
else
start_test "examples-auto-provision-kafka"
example_name="auto-provision-kafka"
render_install_kafka_operator "01"
render_install_example "$example_name" "02"
if [[ $IS_OPENSHIFT = true && $SKIP_ES_EXTERNAL = true ]]; then
$YQ e -i '.spec.storage.options={}' ./02-install.yaml
$YQ e -i '.spec.storage.elasticsearch={"nodeCount":1,"resources":{"limits":{"memory":"2Gi"}}}' ./02-install.yaml
else
render_install_elasticsearch "upstream" "00"
fi
# The Kafka cluster will be started before the Jaeger components. So, we do the
# Jaeger assertion later and the Kafka cluster assertion now
mv ./02-assert.yaml ./05-assert.yaml
render_assert_kafka "true" "$example_name" "02"
render_smoke_test_example "$example_name" "06"
fi


###############################################################################
# TEST NAME: examples-business-application-injected-sidecar
###############################################################################
Expand Down Expand Up @@ -176,23 +144,22 @@ render_install_cassandra "00"
render_install_example "$example_name" "01"
render_smoke_test_example "$example_name" "02"


###############################################################################
# OpenShift examples ##########################################################
# TEST NAME: examples-agent-as-daemonset
###############################################################################
start_test "examples-agent-as-daemonset"
if [ $IS_OPENSHIFT = true ]; then
start_test "examples-openshift-agent-as-daemonset"
prepare_daemonset "00"
$GOMPLATE -f $EXAMPLES_DIR/openshift/agent-as-daemonset.yaml -o 02-install.yaml
JAEGER_NAME="agent-as-daemonset" $GOMPLATE -f $TEMPLATES_DIR/allinone-jaeger-assert.yaml.template -o ./02-assert.yaml
render_install_vertx "03"
$YQ e -i '.spec.template.spec.containers[0].env=[{"name": "JAEGER_AGENT_HOST", "valueFrom": {"fieldRef": {"apiVersion": "v1", "fieldPath": "status.hostIP"}}}]' ./03-install.yaml
render_find_service "agent-as-daemonset" "production" "order" "00" "04"
else
skip_test "examples-openshift-agent-as-daemonset" "This test is only supported in OpenShift"
rm ./01-add-policy.yaml # This is just for OpenShift
render_install_example "agent-as-daemonset" "02"
fi


###############################################################################
# OpenShift examples ##########################################################
###############################################################################
if [ $IS_OPENSHIFT = true ]; then
start_test "examples-openshift-with-htpasswd"
export JAEGER_NAME="with-htpasswd"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: autoscaling/v1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
labels:
Expand All @@ -16,4 +16,3 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: simple-prod-collector
targetCPUUtilizationPercentage: 90

This file was deleted.

16 changes: 2 additions & 14 deletions tests/e2e/miscellaneous/collector-autoscale/03-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: autoscaling/v2
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
labels:
Expand All @@ -11,21 +11,9 @@ metadata:
name: simple-prod-collector
spec:
maxReplicas: 2
metrics:
- resource:
name: cpu
target:
averageUtilization: 90
type: Utilization
type: Resource
- resource:
name: memory
target:
averageUtilization: 90
type: Utilization
type: Resource
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: simple-prod-collector
targetCPUUtilizationPercentage: 90
10 changes: 0 additions & 10 deletions tests/e2e/miscellaneous/collector-autoscale/wait-for-hpa.sh

This file was deleted.

6 changes: 3 additions & 3 deletions tests/e2e/miscellaneous/render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ $YQ e -i '.spec.collector.autoscale=true' 01-install.yaml
$YQ e -i '.spec.collector.minReplicas=1' 01-install.yaml
$YQ e -i '.spec.collector.maxReplicas=2' 01-install.yaml

if kubectl api-versions | grep "autoscaling/v2beta2" -q; then
if version_lt $KUBE_VERSION "1.23"; then
# Use the autoscaling/v2beta2 file
rm ./03-assert.yaml
rm ./02-assert.yaml
else
# Use the autoscaling/v2 file
rm ./04-assert.yaml
rm ./03-assert.yaml
fi

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/render-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ function render_assert_kafka(){
REPLICAS=$replicas \
$GOMPLATE \
-f $TEMPLATES_DIR/assert-kafka-cluster.yaml.template \
-o ./$(expr $test_step + 1 )-assert.yaml
-o ./0$(expr $test_step + 1 )-assert.yaml
CLUSTER_NAME=$cluster_name \
$GOMPLATE \
-f $TEMPLATES_DIR/assert-entity-operator.yaml.template \
Expand Down
8 changes: 5 additions & 3 deletions tests/e2e/streaming/render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ else
# Assert the autoprovisioned Kafka deployment
render_assert_kafka "true" "$jaeger_name" "03"

# Create the tracegen deployment
# Deploy Tracegen instance to generate load in the Jaeger collector
render_install_tracegen "$jaeger_name" "06"
if version_lt $KUBE_VERSION "1.23"; then
rm ./07-assert.yaml
else
rm ./08-assert.yaml
fi
fi
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Assert the ingester scaled
apiVersion: apps/v1
kind: Deployment
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: auto-provisioned-collector
spec:
maxReplicas: 100
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: auto-provisioned-collector
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: auto-provisioned-ingester
status:
readyReplicas: 2
spec:
maxReplicas: 2
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: auto-provisioned-ingester
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: auto-provisioned-ingester
spec:
maxReplicas: 2
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: auto-provisioned-ingester
targetCPUUtilizationPercentage: 90

0 comments on commit 4f201e6

Please sign in to comment.