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

Add contract testing for policies #1847

Merged
merged 21 commits into from
Jun 3, 2024
Merged

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented May 20, 2024

Add a new policy test runner that can be used to test different sets of configuration values.

With this test runner, a set of package or data stream variables can be used to create a policy, and the policy can be compared with a pre-generated one.

Examples are provided for the sql_input and apache test packages.

Closes #947

@jsoriano jsoriano self-assigned this May 20, 2024
@jsoriano
Copy link
Member Author

Waiting for upcoming release of package-spec including the definitions for policy test files.

@jsoriano jsoriano marked this pull request as ready for review May 23, 2024 18:12
@jsoriano jsoriano requested a review from a team June 3, 2024 10:23
Copy link
Contributor

@mrodm mrodm left a comment

Choose a reason for hiding this comment

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

🚀

cmd/testrunner.go Outdated Show resolved Hide resolved
cmd/testrunner.go Outdated Show resolved Hide resolved
internal/testrunner/runners/policy/policy.go Outdated Show resolved Hide resolved
name: system
name: test-httpjson-secret-system
streams:
- auth.basic.password: ${SECRET_0}
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect, I was wondering how it would be written/tested secrets
👍

Co-authored-by: Mario Rodriguez Molins <marrodmo@gmail.com>
@jsoriano jsoriano enabled auto-merge (squash) June 3, 2024 11:51
@jsoriano jsoriano merged commit 668609f into elastic:main Jun 3, 2024
3 checks passed
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @jsoriano

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.

[Testing] Add contract testing for agent policies
3 participants