Abstract out agent execution environment #118
Labels
enhancement
New feature or request
Epic
Umbrella issue for implementing multiple features or solving multiple issues
The disruptor agent is responsible for injecting faults in the disruption target. The reliability of the agent is critical to ensure the chaos tests do not disrupt the target in unpredictable ways or that its effects last beyond the duration of the fault injection. Therefore, the testability of the agent is a key requirement.
However, in order to inject faults, the agent must interact with the target's execution environment. For example, executing commands to modify the configuration or execute other tasks.
These kinds of interactions are difficult to test because the functions the golang standard library offers for interacting with the execution environment (mostly under the os package) are not provided as interfaces that could be mocked.
One alternative that has already been applied for the execution of commands is to provide abstractions for these functions that can be easily mocked in tests.
This approach can be extended to:
This same approach has been used in k6 by introducing a global state
The text was updated successfully, but these errors were encountered: