grafana / xk6-disruptor

Extension for injecting faults into k6 tests
https://k6.io/docs/javascript-api/xk6-disruptor/
GNU Affero General Public License v3.0
89 stars 9 forks source link

Reorganize the project to separate agent and extension code #375

Open pablochacin opened 9 months ago

pablochacin commented 9 months ago

The disruptor consists of two main parts: a k6 extension and an agent that runs in the targets of the fault injection.

Presently, the separation of these two components is not evident in the code structure:

cmd
   |-- agent  // agent command
pkg
  |-- agent                 // agent implementation
  |-- api                     // extension api
  |-- disruptors          // extension implementation
  |-- iptables             // used by the agent
  |-- kubernetes       // used by the extension
  |-- runtime             // used by the agent
  |-- testutils             // used by agent and extension
  |-- other packages (some may be shared)

This lack of clear separation brings some issues. For example, the extension is expected to be multiplatform (as k6 itself is), while the agent in intended to run only in linux targets. having to use build constrains to prevent some packages to build (or be tested) in non linux platforms can be tedious.

Therefore, It would be convenient to separate the code in at least four separate components:

An open question is whether these components should be independent modules in the same repository.