Skip to content

Add RandomInjector and ChainInjector#12

Merged
kenichirow merged 4 commits intomainfrom
feature/composite-injectors
Feb 16, 2026
Merged

Add RandomInjector and ChainInjector#12
kenichirow merged 4 commits intomainfrom
feature/composite-injectors

Conversation

@kenichirow
Copy link
Owner

Summary

  • Add RandomInjector that randomly selects one injector from a list to execute
  • Add ChainInjector that executes all injectors sequentially and returns the last response (e.g. delay then error)
  • Add build-time validation for injectors field (rejects nil/empty list)
  • Fix fill_matcher_params to properly default nil struct fields

kenichirow and others added 4 commits February 17, 2026 00:07
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
RandomInjector randomly selects one injector from a list to execute,
while ChainInjector executes all injectors sequentially and returns
the last response. Inspired by go-fault's composite injectors.
Move each module from the monolithic injector.ex into its own file
following Elixir's one-file-per-module convention. Add @moduledoc to
Faultex.Injector, Faultex.Response, RandomInjector, and ChainInjector.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kenichirow kenichirow merged commit 9ccb0b3 into main Feb 16, 2026
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.

1 participant