Provide facilities to run tests inside fixtures

50 views
Skip to first unread message

Jason Axelson

unread,
Jan 11, 2020, 12:31:32 PM1/11/20
to elixir-l...@googlegroups.com
Hi,

I'm working on maintaining ElixirLS (https://github.com/elixir-lsp/elixir-ls/) and trying to cut down on the number of private api's it uses. One of these is a re-implementation of MixTest.Case that uses private functions from Mix.ProjectStack:


In order to replace that usage we need to be able to run our tests in various fixtures, similarly to how the mix tests do in https://github.com/elixir-lang/elixir/blob/c7f0295d6da268ffc85292e104f11f4d08423805/lib/mix/test/mix/umbrella_test.exs#L7

Here's an example of using the `in_fixture` from the copy of `MixTest.Case`:

Any suggestions for alternative patterns would be helpful as well, but ideally the similar test cases could be kept in the same file so that they can be easily compared, even if they require code from different test fixtures.

Thanks,
Jason

José Valim

unread,
Jan 12, 2020, 10:13:03 AM1/12/20
to elixir-l...@googlegroups.com
Hi Jason!

I wonder if you could stop and start the Mix application before and/or after every test and if that would be enough to purge/clear all state. Maybe it won't  work with `mix test` per-se but it is worth trying.


José Valim
Founder and Director of R&D


--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAHMz6kzpqbHm%2B7BFCjEOqum29Pbma9m-OG8hjgDfw6fMm1trmw%40mail.gmail.com.

Jason Axelson

unread,
Jan 17, 2020, 7:38:01 PM1/17/20
to elixir-l...@googlegroups.com
Hi José!

I'm not sure I follow what you are proposing. How would we start/stop the Mix application? Do you mean using `Application.stop/1` (I don't see anything in the Mix docs about starting or stopping applications)?

Thanks,
Jason

José Valim

unread,
Jan 17, 2020, 7:40:29 PM1/17/20
to elixir-l...@googlegroups.com

Jason Axelson

unread,
Jan 17, 2020, 8:23:02 PM1/17/20
to elixir-l...@googlegroups.com
Okay, I'll give it a try.

Thanks!

Reply all
Reply to author
Forward
0 new messages