Skip to content

Commit

Permalink
fix: catch pods logs the correct ns + expand timeout for context prop… (
Browse files Browse the repository at this point in the history
#1770)

…ogation trace verification
  • Loading branch information
tamirdavid1 authored Nov 19, 2024
1 parent a6f1ad8 commit d30d41a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 37 deletions.
2 changes: 1 addition & 1 deletion tests/common/traceql_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function process_yaml_file() {
echo "Test FAILED: expected $expected_count got $num_of_traces"
exit 1
else
echo "Test PASSED"
echo "Test PASSED: expected $expected_count got $num_of_traces"
exit 0
fi
}
Expand Down
32 changes: 20 additions & 12 deletions tests/e2e/cli-upgrade/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,34 @@ spec:
- name: Generate Traffic
try:
- script:
timeout: 60s
timeout: 300s
content: |
# Make sure that odigos components are ready
sleep 20
# Apply the job
kubectl apply -f 05-generate-traffic.yaml
# Wait for the job to complete
job_name=$(kubectl get -f 05-generate-traffic.yaml -o=jsonpath='{.metadata.name}')
kubectl wait --for=condition=complete job/$job_name
# Delete the job
kubectl delete -f 05-generate-traffic.yaml
while true; do
# Apply the job
kubectl apply -f 05-generate-traffic.yaml
# Wait for the job to complete
job_name=$(kubectl get -f 05-generate-traffic.yaml -o=jsonpath='{.metadata.name}')
kubectl wait --for=condition=complete job/$job_name
# Delete the job
kubectl delete -f 05-generate-traffic.yaml
# wait for traces to be available
sleep 8
# Run the wait-for-trace script
echo "Running TraceQL test at $(date)"
../../common/traceql_runner.sh tracesql/wait-for-trace.yaml
if [ $? -eq 0 ]; then
break
else
sleep 3
../../common/flush_traces.sh
sleep 5
fi
done
- name: Verify Trace - Context Propagation
Expand Down
32 changes: 19 additions & 13 deletions tests/e2e/helm-chart/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,37 +135,43 @@ spec:
- name: Generate Traffic
try:
- script:
timeout: 60s
timeout: 300s
content: |
while true; do
# Apply the job
kubectl apply -f 05-generate-traffic.yaml
# Apply the job
kubectl apply -f 05-generate-traffic.yaml
# Wait for the job to complete
job_name=$(kubectl get -f 05-generate-traffic.yaml -o=jsonpath='{.metadata.name}')
kubectl wait --for=condition=complete job/$job_name
# Wait for the job to complete
job_name=$(kubectl get -f 05-generate-traffic.yaml -o=jsonpath='{.metadata.name}')
kubectl wait --for=condition=complete job/$job_name
# Delete the job
kubectl delete -f 05-generate-traffic.yaml
# Delete the job
kubectl delete -f 05-generate-traffic.yaml
while true; do
# wait for traces to be available
sleep 8

# Run the wait-for-trace script
echo "Running TraceQL test at $(date)"
../../common/traceql_runner.sh tracesql/wait-for-trace.yaml

if [ $? -eq 0 ]; then
break
else
sleep 3
../../common/flush_traces.sh
sleep 5
fi
done
- name: Verify Trace - Context Propagation
try:
- script:
timeout: 30s
content: |
../../common/traceql_runner.sh tracesql/context-propagation.yaml
catch:
- podLogs:
name: odiglet
namespace: odigos-system
namespace: odigos-test-ns
- name: Verify Trace - Resource Attributes
try:
- script:
Expand All @@ -174,7 +180,7 @@ spec:
catch:
- podLogs:
name: odiglet
namespace: odigos-system
namespace: odigos-test-ns
- name: Verify Trace - Span Attributes
try:
- script:
Expand All @@ -183,7 +189,7 @@ spec:
catch:
- podLogs:
name: odiglet
namespace: odigos-system
namespace: odigos-test-ns

- name: Start Odigos UI in background
try:
Expand Down
26 changes: 16 additions & 10 deletions tests/e2e/multi-apps/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,37 @@ spec:
- name: Generate Traffic
try:
- script:
timeout: 60s
timeout: 300s
content: |
while true; do
# Apply the job
kubectl apply -f 05-generate-traffic.yaml
# Apply the job
kubectl apply -f 05-generate-traffic.yaml
# Wait for the job to complete
job_name=$(kubectl get -f 05-generate-traffic.yaml -o=jsonpath='{.metadata.name}')
kubectl wait --for=condition=complete job/$job_name
# Wait for the job to complete
job_name=$(kubectl get -f 05-generate-traffic.yaml -o=jsonpath='{.metadata.name}')
kubectl wait --for=condition=complete job/$job_name
# Delete the job
kubectl delete -f 05-generate-traffic.yaml
# Delete the job
kubectl delete -f 05-generate-traffic.yaml
while true; do
# wait for traces to be available
sleep 8
# Run the wait-for-trace script
echo "Running TraceQL test at $(date)"
../../common/traceql_runner.sh tracesql/wait-for-trace.yaml
if [ $? -eq 0 ]; then
break
else
sleep 3
../../common/flush_traces.sh
sleep 5
fi
done
- name: Verify Trace - Context Propagation
try:
- script:
timeout: 30s
content: |
../../common/traceql_runner.sh tracesql/context-propagation.yaml
catch:
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/workload-lifecycle/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
- name: Build and Load Test App Images
try:
- script:
timeout: 350s
timeout: 450s
content: |
docker build -t nodejs-unsupported-version:v0.0.1 -f services/nodejs-http-server/unsupported-version.Dockerfile services/nodejs-http-server
kind load docker-image nodejs-unsupported-version:v0.0.1
Expand Down

0 comments on commit d30d41a

Please sign in to comment.