To clarify, --stale does not run previously failed tests. > I just changed the format of the message built within `MyApp.Mixpanel`. This caused `assert_receive` to fail in tests throughout my app, as expected. But since the tests didn't directly reference `MyApp.Mixpanel`, `--stale` didn't know which ones should be run when the message format changed; I had to run all tests to get them to fail.
That feels like a bug. Maybe we are being conservative on how we compute the dependencies. If you can provide a sample app that reproduces the error, I would love to take a look at it. *José Valimwww.plataformatec.com.br <http://www.plataformatec.com.br/>Founder and Director of R&D* On Wed, Nov 22, 2017 at 8:06 PM, Nathan Long <[email protected]> wrote: > Sure. I have a module called `MyApp.Mixpanel` with functions like > `track_event(:user_signup, data_map)`. These are called from various places > throughout the codebase. There's a production adapter, which actually sends > the event data to Mixpanel for analytics purposes, a dev adapter, which > just logs it, and a test adapter, which sends it to `self()` as a message. > > Several of my tests say things like "if I POST the info required for a new > user signup, I should get a message showing that the correct info would > have been sent to Mixpanel." These use `assert_receive`. > > I just changed the format of the message built within `MyApp.Mixpanel`. > This caused `assert_receive` to fail in tests throughout my app, as > expected. But since the tests didn't directly reference `MyApp.Mixpanel`, > `--stale` didn't know which ones should be run when the message format > changed; I had to run all tests to get them to fail. > > This is no big deal, but it would be nice in such situations to run all > tests once, then be able to whittle down the failing tests without > re-running the whole suite. > > On Wednesday, November 22, 2017 at 4:54:51 PM UTC-5, Louis Pilfold wrote: >> >> Hi Nathan >> >> I feel ExUnit --stale should always be able to tell this. Could you share >> your example please? >> >> Cheers, >> Louis >> >> On Wed, 22 Nov 2017 at 20:43 Nathan Long <[email protected]> wrote: >> >>> Ruby's Rspec has a handy option, `--only-failures`, which "filters what >>> examples are run so that only those that failed the last time they ran are >>> executed". https://relishapp.com/rspec/rspec-core/docs/command-line/onl >>> y-failures >>> >>> I'd love to have this feature in ExUnit. The closest thing I see right >>> now is `--stale`, but if ExUnit can't accurately determine which tests may >>> have been broken by a change, it doesn't work. (I have such an example, but >>> don't want to be long-winded; maybe the utility of this feature is clear >>> enough?) >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "elixir-lang-core" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/elixir-lang-core/f5881fa3-ed51-44be-8f6b-81e5181fa449% >>> 40googlegroups.com >>> <https://groups.google.com/d/msgid/elixir-lang-core/f5881fa3-ed51-44be-8f6b-81e5181fa449%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/elixir-lang-core/2aa483e6-f63c-42d6-9e4b- > 84efb8adf9de%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/2aa483e6-f63c-42d6-9e4b-84efb8adf9de%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BvLgPNKS2AND41ZuzLqzXWjUD1AtF2RrnumYQ61hrYQA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
