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

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

@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

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

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

Link to this function

clear_excludes(settings)

View Source
@spec clear_excludes(t()) :: t()

Update settings to clear any excluded tags.

Link to this function

clear_includes(settings)

View Source
@spec clear_includes(t()) :: t()

Update settings to clear any included tags.

Link to this function

clear_max_failures(settings)

View Source
@spec clear_max_failures(t()) :: t()

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

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

Update settings to clear any "only" tags.

Link to this function

clear_repeat_count(settings)

View Source
@spec clear_repeat_count(t()) :: t()

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

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

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

@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.

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

Update settings to only run failing tests.

Corresponds to mix test --failed.

Link to this function

only_patterns(settings, patterns)

View Source
@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.

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

Update settings to only run "stale" tests.

Corresponds to mix test --stale.

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

Return a text summary of the current interactive mode settings.

Link to this function

toggle_tracing(settings)

View Source
@spec toggle_tracing(t()) :: t()

Toggle test tracing on or off.

Link to this function

toggle_watch_mode(settings)

View Source
@spec toggle_watch_mode(t()) :: t()

Toggle file-watching mode on or off.

Link to this function

with_excludes(settings, excludes)

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

Exclude tests with the specified tags.

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

Link to this function

with_includes(settings, includes)

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

Include tests with the specified tags.

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

Link to this function

with_max_failures(settings, max)

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

Stop running tests after a maximum number of failures.

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

Link to this function

with_only(settings, only)

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

Run only the tests with the specified tags.

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

Link to this function

with_repeat_count(settings, count)

View Source
@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>.

Link to this function

with_seed(settings, seed)

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

Update settings to run tests with a specific seed.

Corresponds to mix test --seed <seed>.