mix_test_interactive icon indicating copy to clipboard operation
mix_test_interactive copied to clipboard

Config-less operation

Open randycoulman opened this issue 2 years ago • 1 comments

Some of mix_test_interactive's behavior can be modified using application configuration. For example, the clear, exclude, and task options can only be configured in app config.

Projects generated with mix new no longer include a config by default (for good reasons), which makes it harder to customize mix_test_interactive.

Ideally, there would be a way to customize mix_task_interactive without using application configuration. The most obvious answer to this would be to also support command-line arguments for configuring these settings.

In order to do this, there are some problems to solve:

  • Conflicts between mix_test_interactive's command-line arguments and mix test's arguments. For example, mix test already takes an --exclude argument that would conflict with mix_test_interactive's config setting. We might want to use a prefix for our own arguments like mti- or _ or similar.
  • Specifying complex argument values, like the array needed by exclude or the command setting proposed in #63. We could attempt to parse an Elixir array from those arguments, but would have to find a way to do that in a secure way that didn't allow for malicious code.

randycoulman avatar Nov 29 '22 00:11 randycoulman

The exclude option can simply be repeatable, so if you need to pass multiple regexes, do you --exlude 'db_migration\/.*' --exclude 'useless_.*\.exs'.

The command option could be a string that is split by spaces. The problem is if there is an argument that has spaces and needs quotes.

jfpedroza avatar Nov 29 '22 01:11 jfpedroza

Done in #108 and releases in v4.0.0

randycoulman avatar Sep 17 '24 03:09 randycoulman