View Source MixTestInteractive.Settings (mix test.interactive v4.1.2)

Interactive mode settings.

Keeps track of the current settings of MixTestInteractive.InteractiveMode, making changes in response to user commands.

Summary

Functions

Update settings to run all tests, removing any flags or filter patterns.

Update settings to clear any excluded tags.

Update settings to clear any included tags.

Update settings to run with unlimited failures, clearing any specified maximum number of failures.

Update settings to clear any "only" tags.

Update settings to run tests only once, clearing any repeat-until-failure count.

Update settings to run tests with a random seed, clearing any specified seed.

Assemble command-line arguments to pass to mix test.

Update settings to only run failing tests.

Provide a list of file-name filter patterns.

Update settings to only run "stale" tests.

Return a text summary of the current interactive mode settings.

Toggle test tracing on or off.

Toggle file-watching mode on or off.

Exclude tests with the specified tags.

Include tests with the specified tags.

Stop running tests after a maximum number of failures.

Run only the tests with the specified tags.

Update settings to run tests <count> times until failure.

Update settings to run tests with a specific seed.

Types

t()

@type t() :: %MixTestInteractive.Settings{
  excludes: [String.t()],
  failed?: boolean(),
  includes: [String.t()],
  initial_cli_args: [String.t()],
  list_all_files: (-> [String.t()]),
  max_failures: String.t() | nil,
  only: [String.t()],
  patterns: [String.t()],
  repeat_count: String.t() | nil,
  seed: String.t() | nil,
  stale?: boolean(),
  tracing?: boolean(),
  watching?: boolean()
}

Functions

all_tests(settings)

@spec all_tests(t()) :: t()

Update settings to run all tests, removing any flags or filter patterns.

clear_excludes(settings)

@spec clear_excludes(t()) :: t()

Update settings to clear any excluded tags.

clear_includes(settings)

@spec clear_includes(t()) :: t()

Update settings to clear any included tags.

clear_max_failures(settings)

@spec clear_max_failures(t()) :: t()

Update settings to run with unlimited failures, clearing any specified maximum number of failures.

clear_only(settings)

@spec clear_only(t()) :: t()

Update settings to clear any "only" tags.

clear_repeat_count(settings)

@spec clear_repeat_count(t()) :: t()

Update settings to run tests only once, clearing any repeat-until-failure count.

clear_seed(settings)

@spec clear_seed(t()) :: t()

Update settings to run tests with a random seed, clearing any specified seed.

cli_args(settings)

@spec cli_args(t()) :: {:ok, [String.t()]} | {:error, :no_matching_files}

Assemble command-line arguments to pass to mix test.

Includes arguments originally passed to mix test.interactive when it was started as well as arguments based on the current interactive mode settings.

only_failed(settings)

@spec only_failed(t()) :: t()

Update settings to only run failing tests.

Corresponds to mix test --failed.

only_patterns(settings, patterns)

@spec only_patterns(t(), [String.t()]) :: t()

Provide a list of file-name filter patterns.

Only test filenames matching one or more patterns will be run.

only_stale(settings)

@spec only_stale(t()) :: t()

Update settings to only run "stale" tests.

Corresponds to mix test --stale.

summary(settings)

@spec summary(t()) :: String.t()

Return a text summary of the current interactive mode settings.

toggle_tracing(settings)

@spec toggle_tracing(t()) :: t()

Toggle test tracing on or off.

toggle_watch_mode(settings)

@spec toggle_watch_mode(t()) :: t()

Toggle file-watching mode on or off.

with_excludes(settings, excludes)

@spec with_excludes(t(), [String.t()]) :: t()

Exclude tests with the specified tags.

Corresponds to mix test --exclude <tag1> --exclude <tag2> ....

with_includes(settings, includes)

@spec with_includes(t(), [String.t()]) :: t()

Include tests with the specified tags.

Corresponds to mix test --include <tag1> --include <tag2> ....

with_max_failures(settings, max)

@spec with_max_failures(t(), String.t()) :: t()

Stop running tests after a maximum number of failures.

Corresponds to mix test --max-failures <max>.

with_only(settings, only)

@spec with_only(t(), [String.t()]) :: t()

Run only the tests with the specified tags.

Corresponds to mix test --only <tag1> --only <tag2> ....

with_repeat_count(settings, count)

@spec with_repeat_count(t(), String.t()) :: t()

Update settings to run tests <count> times until failure.

Corresponds to mix test --repeat-until-failure <count>.

with_seed(settings, seed)

@spec with_seed(t(), String.t()) :: t()

Update settings to run tests with a specific seed.

Corresponds to mix test --seed <seed>.