Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mix test --no-start #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Mix test --no-start #3

wants to merge 1 commit into from

Conversation

ktec
Copy link
Owner

@ktec ktec commented Jan 29, 2020

By preventing the application tree starting automatically we're able to
start the worker as we need, however this does mean each test will need
to start the processes it needs. This could be a contenious issue.

One downside of this approach is that we're now forced to set Mox into
"global" mode because we don't have a pid to pass to Mox.allow/2 and
we need to call Mox.expect/2 before calling Worker.start_link/0 AND
we need the newly created Worker process to be able to "see" the
mocked foo/0 function. Basically it's a chicken and egg situation.

By preventing the application tree starting automatically we're able to
start the worker as we need, however this does mean each test will need
to start the processes it needs. This could be a contenious issue.

One downside of this approach is that we're now forced to set Mox into
"global" mode because we don't have a pid to pass to `Mox.allow/2` and
we need to call `Mox.expect/2` before calling `Worker.start_link/0` AND
we need the newly created `Worker` process to be able to "see" the
mocked `foo/0` function. Basically it's a chicken and egg situation.
@ktec ktec self-assigned this Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant