Skip to content

Commit

Permalink
tests: add basic test for workload lifecycle (#1526)
Browse files Browse the repository at this point in the history
  • Loading branch information
blumamir authored Sep 25, 2024
1 parent 06f8b3f commit 1f72de6
Show file tree
Hide file tree
Showing 34 changed files with 2,556 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
frontend/node_modules
frontend/webapp/node_modules
.git/
Dockerfile
odiglet/Dockerfile
odiglet/base.Dockerfile
odiglet/debug.Dockerfile
tests # not needed in context for odigos components builds
1 change: 1 addition & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
- "helm-chart"
- "fe-synthetic"
- "cli-upgrade"
- "workload-lifecycle"
include:
- kube-version: "1.23"
kind-image: "kindest/node:v1.23.17@sha256:14d0a9a892b943866d7e6be119a06871291c517d279aedb816a4b4bc0ec0a5b3"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,4 @@ dev-tests-setup: dev-tests-kind-cluster cli-build build-images load-to-kind
# Use this target to avoid rebuilding the images if all that changed is the e2e test code
.PHONY: dev-tests-setup-no-build
dev-tests-setup-no-build: TAG := e2e-test
dev-tests-setup-no-build: dev-tests-kind-cluster load-to-kind
dev-tests-setup-no-build: dev-tests-kind-cluster load-to-kind
1 change: 1 addition & 0 deletions tests/e2e/multi-apps/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@ spec:
timeout: 60s
content: |
../../common/ui-tests/stop_ui_and_clean.sh
12 changes: 12 additions & 0 deletions tests/e2e/workload-lifecycle/01-add-destination.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: odigos.io/v1alpha1
kind: Destination
metadata:
name: odigos.io.dest.tempo-123123
namespace: odigos-system
spec:
data:
TEMPO_URL: e2e-tests-tempo.traces:4317
destinationName: e2e-tests
signals:
- TRACES
type: tempo
98 changes: 98 additions & 0 deletions tests/e2e/workload-lifecycle/01-assert-apps-installed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
apiVersion: v1
kind: Pod
metadata:
labels:
app: nodejs-unsupported-version
namespace: default
status:
containerStatuses:
- name: nodejs-unsupported-version
ready: true
restartCount: 0
started: true
phase: Running
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: nodejs-very-old-version
namespace: default
status:
containerStatuses:
- name: nodejs-very-old-version
ready: true
restartCount: 0
started: true
phase: Running
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: nodejs-minimum-version
namespace: default
status:
containerStatuses:
- name: nodejs-minimum-version
ready: true
restartCount: 0
started: true
phase: Running
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: nodejs-latest-version
namespace: default
status:
containerStatuses:
- name: nodejs-latest-version
ready: true
restartCount: 0
started: true
phase: Running
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: nodejs-dockerfile-env
namespace: default
status:
containerStatuses:
- name: nodejs-dockerfile-env
ready: true
restartCount: 0
started: true
phase: Running
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: nodejs-manifest-env
namespace: default
status:
containerStatuses:
- name: nodejs-manifest-env
ready: true
restartCount: 0
started: true
phase: Running
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: cpp-http-server
namespace: default
status:
containerStatuses:
- name: cpp-http-server
ready: true
restartCount: 0
started: true
phase: Running
---
174 changes: 174 additions & 0 deletions tests/e2e/workload-lifecycle/01-assert-instrumented.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
namespace: default
name: deployment-nodejs-unsupported-version
status:
conditions:
- message: "javascript runtime version not supported by OpenTelemetry SDK. Found:
8.17.0, supports: 14.0.0"
observedGeneration: 1
reason: RuntimeVersionNotSupported
status: "False"
type: AppliedInstrumentationDevice
---
# expecting injection of instrumentation device to be successful since the runtime version was not detected
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
namespace: default
name: deployment-nodejs-very-old-version
status:
conditions:
- message: "Instrumentation device applied successfully"
observedGeneration: 1
reason: InstrumentationDeviceApplied
status: "True"
type: AppliedInstrumentationDevice
---
# expecting injection of instrumentation device to be successful since the runtime version is supported
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
namespace: default
name: deployment-nodejs-minimum-version
status:
conditions:
- message: "Instrumentation device applied successfully"
observedGeneration: 1
reason: InstrumentationDeviceApplied
status: "True"
type: AppliedInstrumentationDevice
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentationInstance
metadata:
namespace: default
labels:
instrumented-app: deployment-nodejs-minimum-version
status:
healthy: true
identifyingAttributes:
- key: service.instance.id
(value != null): true
- key: telemetry.sdk.language
value: nodejs
- key: process.runtime.version
value: "14.0.0"
- key: telemetry.distro.version
value: e2e-test
- key: process.pid
(value != null): true
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
namespace: default
name: deployment-nodejs-latest-version
status:
conditions:
- message: "Instrumentation device applied successfully"
observedGeneration: 1
reason: InstrumentationDeviceApplied
status: "True"
type: AppliedInstrumentationDevice
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentationInstance
metadata:
namespace: default
labels:
instrumented-app: deployment-nodejs-latest-version
status:
healthy: true
identifyingAttributes:
- key: service.instance.id
(value != null): true
- key: telemetry.sdk.language
value: nodejs
- key: process.runtime.version
(value != null): true
- key: telemetry.distro.version
value: e2e-test
- key: process.pid
(value != null): true
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
namespace: default
name: deployment-nodejs-dockerfile-env
status:
conditions:
- message: "Instrumentation device applied successfully"
observedGeneration: 1
reason: InstrumentationDeviceApplied
status: "True"
type: AppliedInstrumentationDevice
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentationInstance
metadata:
namespace: default
labels:
instrumented-app: deployment-nodejs-dockerfile-env
status:
healthy: true
identifyingAttributes:
- key: service.instance.id
(value != null): true
- key: telemetry.sdk.language
value: nodejs
- key: process.runtime.version
value: "20.17.0"
- key: telemetry.distro.version
value: e2e-test
- key: process.pid
(value != null): true
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
namespace: default
name: deployment-nodejs-manifest-env
status:
conditions:
- message: "Instrumentation device applied successfully"
observedGeneration: 1
reason: InstrumentationDeviceApplied
status: "True"
type: AppliedInstrumentationDevice
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentationInstance
metadata:
namespace: default
labels:
instrumented-app: deployment-nodejs-manifest-env
status:
healthy: true
identifyingAttributes:
- key: service.instance.id
(value != null): true
- key: telemetry.sdk.language
value: nodejs
- key: process.runtime.version
value: "20.17.0"
- key: telemetry.distro.version
value: e2e-test
- key: process.pid
(value != null): true
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
namespace: default
name: deployment-cpp-http-server
status:
conditions:
- message: "Instrumentation device applied successfully"
observedGeneration: 1
reason: InstrumentationDeviceApplied
status: "True"
type: AppliedInstrumentationDevice
---
Loading

0 comments on commit 1f72de6

Please sign in to comment.