Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: added catch statement in lifecycle-operator integration tests #3233

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,14 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that keptnworkloadinstance and keptnapp are needed here? AFAIK they are not created in this test (please check 00-install.yaml). Also metrics-operator is not used here

- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ spec:
catch:
- podLogs:
selector: app=test
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,25 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- name: step-01
try:
- apply:
file: 01-install.yaml
- assert:
file: 01-assert.yaml
catch:
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,33 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
- name: step-01
try:
- script:
content: ../../common-scripts/verify-number-of-resources.sh "keptntask" "1" $NAMESPACE
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
13 changes: 13 additions & 0 deletions test/chainsaw/integration/container-runtime/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=test
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
30 changes: 30 additions & 0 deletions test/chainsaw/integration/expose-keptn-metric/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ spec:
for:
condition:
name: complete
catch:
- describe:
resource: Job
- podLogs:
selector: kind=no-metric
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
- name: step-01
try:
- apply:
Expand All @@ -32,3 +47,18 @@ spec:
for:
condition:
name: complete
catch:
- describe:
resource: Job
- podLogs:
selector: kind=existing-metric
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
13 changes: 13 additions & 0 deletions test/chainsaw/integration/imagepullsecret/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=test
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=test
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,16 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ spec:
file: 00-install.yaml
- assert:
file: 00-assert.yaml
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator
- name: step-01
try:
- script:
Expand All @@ -31,3 +44,16 @@ spec:
check:
# This checks that Keptn returns active metrics
(contains($stdout, 'keptn_promotion_count_total')): true
catch:
- podLogs:
selector: app=podtato-head
- describe:
resource: keptnworkloadversion
- describe:
resource: keptnappversion
- podLogs:
namespace: keptn-system
selector: control-plane=lifecycle-operator
- podLogs:
namespace: keptn-system
selector: control-plane=metrics-operator