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

[Bug] The catch block in Step with 'continueOnError' in try block should be used only in failed Step(s), not in all consecutives successful Steps in Test #1870

Open
1 task done
jingav opened this issue Aug 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jingav
Copy link

jingav commented Aug 19, 2024

chainsaw version Version

v0.2.8

Description

I have a Test with multiple Steps each with try/catch blocks.
I added 'continueOnError' to all try blocks with True value to get all errors in one run.

The side effect of this change is that now all (even successful) Steps in that Test print catch blocks.
This is polluting report with unnecessary information meant only for troubleshooting in case failure.

Btw. what's the relationship between execution.failFast in .chainsaw.yaml and this 'continueOnError'?
It seems that execution.failFast does nothing.
Expectation would be that I don't have to specify continueOnError per step and will just control it by failFast in config.
And maybe, this continueOnError would overwrite global setting on Step level.

Steps to reproduce

apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
  name: envconfigs
spec:
  steps:
  - name: Assert profile A
    try:
    - continueOnError: true # default is false
      assert:
        file: asserts/envconfig-profile-a.yaml
    catch:
    - describe:
       ....
  - name: Assert profile B
    try:
    - continueOnError: true # default is false
      assert:
        file: asserts/envconfig-profile-b.yaml
    catch:
    - script:
       ....
  - name: Assert profile C
    try:
    - continueOnError: true # default is false
      assert:
        file: asserts/envconfig-profile-c.yaml
    catch:
    - describe:
       ....
    - script:
       ....

Expected behavior

Imagine that assert for profile A is failing.
I would expect that only catch from this step will be in a report.

However, there are also catch and script outputs from profile B and C in the report which is not wanted.

Screenshots

No response

Logs

No response

Slack discussion

No response

Troubleshooting

  • I have searched other issues in this repository and mine is not recorded.
@jingav jingav added the bug Something isn't working label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant