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

feat: Must assertions support #463

Merged
merged 3 commits into from
Dec 13, 2021
Merged

feat: Must assertions support #463

merged 3 commits into from
Dec 13, 2021

Conversation

lowlighter
Copy link
Member

@lowlighter lowlighter commented Dec 8, 2021

Closes #459

Add support to Must assertions

Example:

- steps:
  - type: exec
    script: exit 1
    assertions:
      - result.code MustEqual 0
  # Remaining steps in this context will not be executed

@ovh-cds

This comment has been minimized.

@ovh-cds

This comment has been minimized.

@ovh-cds

This comment has been minimized.

@fsamin
Copy link
Member

fsamin commented Dec 10, 2021

Hi,
Many thanks for your PR.
I don't like very much this new property stop-on-failure: true, My suggestion for this feature would be to handle it through the assertions.

I think we could handle both result.code ShouldEqual 0 and result.code MustEqual 0.
Should and Must would have a different behavior like we have in testify lib with assert.Equals and require.Equals.

If a Must assertions fails : the whole testcase and testsuite would fail immediately.

What do you think ?

@ovh-cds

This comment has been minimized.

@lowlighter
Copy link
Member Author

lowlighter commented Dec 10, 2021

Yeah it's a good idea, I'll look into it 👍

@lowlighter lowlighter changed the title feat: stop-on-failure on test case and custom executors feat: Must assertions support Dec 10, 2021
Signed-off-by: GitHub <[email protected]>
@ovh-cds
Copy link
Collaborator

ovh-cds commented Dec 10, 2021

CDS Report build-venom-a#710.0 ✘

  • Build
    • Build ✔
  • Tests
    • Acceptance Tests ✘

process_testsuite.go Show resolved Hide resolved
@ovh-cds
Copy link
Collaborator

ovh-cds commented Dec 13, 2021

CDS Report build-venom-a#712.0 ✘

  • Build
    • Build ✔
  • Tests
    • Acceptance Tests ✘

@sonarcloud
Copy link

sonarcloud bot commented Dec 13, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

61.9% 61.9% Coverage
0.0% 0.0% Duplication

@yesnault yesnault merged commit 5e90919 into master Dec 13, 2021
@fsamin fsamin deleted the feat-stop-on-failure-steps branch December 15, 2021 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: add stop-on-failure support at steps level
4 participants