-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Summary
Currently, configuring cslb is challenging, especially for applications that rely on it during tests. The primary limitation stems from the use of the cslb_options environment variable during the init phase. This approach provides minimal flexibility for pre-test configuration, as init runs before the test code.
Problem Statement
-
Environment Variable Dependence: Configuration via the cslb_options environment variable happens during init, limiting the ability to dynamically adjust settings during test execution.
-
Testing Challenges: Writing tests for applications using cslb becomes cumbersome because:
-
Configuration must be predefined, making test setup less flexible.
-
Changes to cslb behavior during tests are difficult to implement.
- Code Maintainability: The current approach makes it harder to isolate and test functionality, reducing maintainability and increasing the risk of brittle tests.
Proposed Solution
Introduce configurable options via a new function, such as cslb.EnableWithOptions, or extend the existing cslb.Enable function to accept a configuration object or parameters. This would allow developers to:
- Configure cslb programmatically at runtime.
- Avoid reliance on the cslb_options environment variable.