Skip to content

Commit

Permalink
e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthagenbuch committed May 10, 2024
1 parent 6095564 commit 5fa0025
Show file tree
Hide file tree
Showing 14 changed files with 180 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5558,7 +5558,6 @@ spec:
configVersions:
format: int32
type: integer
default: 3
configmaps:
items:
properties:
Expand Down
6 changes: 0 additions & 6 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
resources:
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: localhost:5001/opentelemetry-operator
newTag: matth-dev-1714590016
2 changes: 1 addition & 1 deletion tests/e2e/managed-reconcile/02-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
apiVersion: v1
kind: ConfigMap
metadata:
name: simplest-collector
name: simplest-collector-17ca6c13
data:
collector.yaml: |
receivers:
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/multiple-configmaps/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
volumes:
- name: otc-internal
configMap:
name: simplest-with-configmaps-collector
name: simplest-with-configmaps-collector-17ca6c13
items:
- key: collector.yaml
path: collector.yaml
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/smoke-targetallocator/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ data:
- jaeger
kind: ConfigMap
metadata:
name: stateful-collector
name: stateful-collector-fb278632
2 changes: 1 addition & 1 deletion tests/e2e/statefulset-features/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
items:
- key: collector.yaml
path: collector.yaml
name: stateful-collector
name: stateful-collector-f0fa6faa
name: otc-internal
- emptyDir: {}
name: testvolume
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/statefulset-features/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
items:
- key: collector.yaml
path: collector.yaml
name: stateful-collector
name: stateful-collector-f0fa6faa
name: otc-internal
- emptyDir: {}
name: testvolume
Expand Down
28 changes: 28 additions & 0 deletions tests/e2e/versioned-configmaps/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-collector
spec:
template:
spec:
volumes:
- name: otc-internal
configMap:
name: simple-collector-d6f40475
items:
- key: collector.yaml
path: collector.yaml
defaultMode: 420
containers:
- name: otc-container
volumeMounts:
- name: otc-internal
mountPath: /conf
status:
readyReplicas: 1
---
apiVersion: v1
kind: ConfigMap
metadata:
name: simple-collector-d6f40475
27 changes: 27 additions & 0 deletions tests/e2e/versioned-configmaps/00-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: simple
spec:
mode: "deployment"
configVersions: 1
config:
receivers:
otlp:
protocols:
grpc: {}
http: {}
processors:
batch:
send_batch_size: 10000
timeout: 10s
exporters:
debug: {}

service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [debug]
33 changes: 33 additions & 0 deletions tests/e2e/versioned-configmaps/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: simple-collector
spec:
template:
spec:
volumes:
- name: otc-internal
configMap:
name: simple-collector-8cd615bf
items:
- key: collector.yaml
path: collector.yaml
defaultMode: 420
containers:
- name: otc-container
volumeMounts:
- name: otc-internal
mountPath: /conf
status:
readyReplicas: 1
---
apiVersion: v1
kind: ConfigMap
metadata:
name: simple-collector-d6f40475
---
apiVersion: v1
kind: ConfigMap
metadata:
name: simple-collector-8cd615bf
27 changes: 27 additions & 0 deletions tests/e2e/versioned-configmaps/01-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: simple
spec:
mode: "deployment"
configVersions: 1
config:
receivers:
otlp:
protocols:
grpc: {}
http: {}
processors:
batch:
send_batch_size: 10000
timeout: 20s
exporters:
debug: {}

service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [debug]
5 changes: 5 additions & 0 deletions tests/e2e/versioned-configmaps/02-error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: simple-collector-d6f40475
27 changes: 27 additions & 0 deletions tests/e2e/versioned-configmaps/02-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: simple
spec:
mode: "deployment"
configVersions: 1
config:
receivers:
otlp:
protocols:
grpc: {}
http: {}
processors:
batch:
send_batch_size: 10000
timeout: 30s
exporters:
debug: {}

service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [debug]
28 changes: 28 additions & 0 deletions tests/e2e/versioned-configmaps/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: versioned-configmaps
spec:
steps:
- name: step-00
try:
- apply:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
# Update the collector config and ensure both the new and old confmaps are present
- name: step-01
try:
- apply:
file: 01-update.yaml
- assert:
file: 01-assert.yaml
# Update the collector config again and ensure the oldest confmap is deleted
- name: step-02
try:
- apply:
file: 02-update.yaml
- error:
file: 02-error.yaml

0 comments on commit 5fa0025

Please sign in to comment.