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

README.md: Improve instructions about async tests with Phoenix #592

Merged

Conversation

jonleighton
Copy link
Contributor

To provide example configuration when an application has additional
resources (above just the SQL database) that should be shared between
processes.

See #591

jonleighton and others added 2 commits March 10, 2021 12:09
To provide example configuration when an application has additional
resources (above just the SQL database) that should be shared between
processes.

See elixir-wallaby#591
@codecov-io
Copy link

codecov-io commented Mar 13, 2021

Codecov Report

Merging #592 (a98a0cb) into main (456b70c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #592   +/-   ##
=======================================
  Coverage   91.79%   91.79%           
=======================================
  Files          24       24           
  Lines         939      939           
=======================================
  Hits          862      862           
  Misses         77       77           
Flag Coverage Δ
IntegrationTest 87.43% <ø> (ø)
UnitTest 41.32% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 456b70c...a98a0cb. Read the comment docs.

@mhanberg
Copy link
Member

I tested this out to make sure I could follow the instructions and it works great!

https://github.com/mhanberg/wallamox

@mhanberg mhanberg merged commit 5557024 into elixir-wallaby:main Mar 13, 2021
@mhanberg mhanberg mentioned this pull request Mar 13, 2021
@jonleighton
Copy link
Contributor Author

Great. I like the name of your repo 🙂

jonleighton added a commit to jonleighton/bamboo that referenced this pull request Aug 8, 2021
This provides a way to receive emails from other processes without
resorting to shared mode and synchronous tests.

For background, this builds on some work that I did to allow Wallaby
tests to play nicely with Mox, while still allowing the tests to be
async. I wrote about it here:

https://jonleighton.name/2021/asynchronous-browser-tests-with-phoenix/

And then contributed some docs to Wallaby about the setup here:

elixir-wallaby/wallaby#592

This commit basically implements a kind of Mox.allow/3 function for
Bamboo.TestAdapter.

Note that I’ve changed the order of the arguments for this
Bamboo.TestAdapter.forward/2 function. For Mox.allow/3, the owner_pid
comes first:

    Mox.allow(MyMock, owner_pid, child_pid)

But for Bamboo.TestAdapter.forward/2, the child_pid comes first:

    Bamboo.TestAdapter.forward(child_pid, owner_pid)

My reasoning is that in the first example we’re allowing the child_pid
to access mocks defined by the owner pid. But in the second example,
we’re forwarding emails FROM the child_pid TO the owner_pid. So this
order of arguments seemed to make sense to me, but may be slightly
confusing.
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.

3 participants