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(decl): make rule and expectedOutcome conditionally optional #259

Conversation

ekoops
Copy link
Contributor

@ekoops ekoops commented Jan 7, 2025

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind documentation

/kind tests

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area commands

/area pkg

/area events

What this PR does / why we need it:

This PR conditionally makes the rule and expectedOutcome fields optional in the YAML tests description.
If the user run a test through the declarative run command or, equivalently, the declarative test --skip-outcome-verification command, these fields are ignored.
If the user run a test through declarative test command, the rule field is mandatory, and an empty expectedOutcome matches any outcome resulting from the application of the test actions.

Which issue(s) this PR fixes:

Fixes #257

Special notes for your reviewer:

Make rule and expectedOutcome not required upon `declarative run`
and `declarative test --skip-outcome-verification` commands
invocation.

Signed-off-by: Leonardo Di Giovanna <[email protected]>
Copy link
Member

@alacuku alacuku left a comment

Choose a reason for hiding this comment

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

/lgtm

@poiana
Copy link

poiana commented Jan 7, 2025

LGTM label has been added.

Git tree hash: 87288e3881bed94ffb54372733df5c620bd11321

@poiana
Copy link

poiana commented Jan 7, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alacuku, ekoops

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the approved label Jan 7, 2025
@poiana poiana merged commit d5c1568 into falcosecurity:declarative-testing Jan 7, 2025
4 of 6 checks passed
@ekoops ekoops deleted the ekoops/run-cmd-optional-fields branch January 7, 2025 16:06
@leogr leogr added this to the v0.13.0 milestone Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Declarative] Make rule name and expected outcome conditionally optional
4 participants