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

Feature: Configurable Threshold Values via config.json #24

Merged

Conversation

jigar-joshi-nirmata
Copy link
Contributor

@jigar-joshi-nirmata jigar-joshi-nirmata commented Jan 15, 2025

Overview

This feature introduces dynamic configurability for test thresholds used in the testing framework. Threshold values can now be set through environment variables, providing flexibility for various testing environments. If no environment variables are provided, the system uses predefined default values to ensure compatibility and ease of use.

Key Features

  • Dynamic Threshold Configuration: Thresholds for different test scenarios can be configured using environment variables.
  • Fallback Defaults: If environment variables are not set, default values are used to maintain consistent behavior.

Default Threshold Values

The following default values are applied when no environment variables are set:

Test Type Default Rate Default Duration
smoke 0.99 600ms
average 0.99 800ms
stress 0.99 1600ms
soak 0.99 800ms
spike 0.99 3200ms
breakpoint 0.99 N/A

Example

To customize the duration for average tests:

export AVERAGE_DURATION=1800

Run the tests, and the custom value will be applied.

Using Environment Variables in Workflows

In workflows, you can pass environment variables using the -e flag. For example:

./k6/run.sh k6/tests/kyverno-pss.js -e SCENARIO=average -e AVERAGE_DURATION=1800 --out dashboard=export=load-report.html

This ensures that custom values are applied dynamically during the test execution.


This feature enhances both flexibility and usability while preserving the stability of existing workflows.

@jigar-joshi-nirmata jigar-joshi-nirmata changed the title Configurable threshold value Feature: Configurable Threshold Values via config.json Jan 15, 2025
Copy link
Collaborator

@KhaledEmaraDev KhaledEmaraDev left a comment

Choose a reason for hiding this comment

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

LGTM!

@KhaledEmaraDev KhaledEmaraDev merged commit 58c500f into kyverno:main Jan 15, 2025
1 check passed
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.

2 participants