randycoulman / mix_test_interactive

Interactive watch mode for Elixir's mix test. https://hexdocs.pm/mix_test_interactive/
MIT License
85 stars 12 forks source link

Support for running test/describe by name #47

Closed Maxim-Filimonov closed 1 year ago

Maxim-Filimonov commented 3 years ago

Hi, Thanks for the great tool! I'd been to contribute if you think it's a good idea to add functionality this functionality from mix test:

mix test --exclude test --include 'test:test file upload on upload for all sets submit for all' file_upload_test.exs

Not sure if we can get list of all tests somehow - maybe with test.trace? or maybe mix.test provides some facility to do so.

randycoulman commented 3 years ago

I'd like to support the include/exclude/only arguments, but haven't been able to come up with a good way to do it because of the ordering dependency between them - it matters if you exclude first or include first. I tend not to use tags, so I'm not sure what patterns people like to use. If you have any ideas there, I'd be interested in your thoughts or contribution.

Does mix test support running tests by name? I don't see that in the docs, but that doesn't mean it doesn't work.

I haven't found a way to get a list of tests from mix test without duplicating its internal code. Plus, the list can change on every run, depending on what files you've changed. I'm not familiar with test.trace, though. Do you have a link to something that describes it? I know about mix test --trace, but I'm not sure that's what you mean.

randycoulman commented 3 years ago

I just remembered that I've already written an issue up for the include/exclude/only` feature; see #31.

jfpedroza commented 1 year ago

Does mix test support running tests by name?

Yes, like the issue mentions. ExUnit generates a test tag with a value that looks like test #{describe name} #{test name} so you can do something like mix test --only 'test:test name' test_file.exs. Passing the test file is actually not necessary, but it will speed things up and will run only one test if another file also defines the name.

I'm not familiar with test.trace, though.

I don't think that's a thing.

Maxim-Filimonov commented 1 year ago

Closing as duplicate of #31