falcosecurity / event-generator

Generate a variety of suspect actions that are detected by Falco rulesets
Apache License 2.0
94 stars 40 forks source link

feat(decl/tests): add declarative test support #235

Closed ekoops closed 3 weeks ago

ekoops commented 3 weeks ago

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 adds support for running declarative tests specification through the Test abstraction. The provided test implementation runs the following logical steps:

  1. Run "before" script
  2. Create test resources
  3. Run test steps
  4. Run test steps cleanup procedures
  5. Destroy test resource
  6. Run "after" script

If running "before" script or creating test resources produces an error, the test execution is aborted, as these logical steps considered prerequisites for test steps execution.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

poiana commented 3 weeks ago

[APPROVALNOTIFIER] This PR is APPROVED

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

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: - ~~[OWNERS](https://github.com/falcosecurity/event-generator/blob/declarative-testing/OWNERS)~~ [FedeDP] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
poiana commented 3 weeks ago

LGTM label has been added.

Git tree hash: 886ed3ed1960939940316129c0382ab5681204d4