elixir icon indicating copy to clipboard operation
elixir copied to clipboard

Make newsletter exercise tests run async

Open halfdan opened this issue 1 year ago • 7 comments

I just went through this exercise as part of the Exhort. It seemed trivial to make this exercise run tests asynchronous by generating random temp files using some core utils.

halfdan avatar Aug 24 '22 14:08 halfdan

Thank you for contributing to exercism/elixir 💜 🎉. This is an automated PR comment 🤖 for the maintainers of this repository that helps with the PR review process. You can safely ignore it and wait for a maintainer to review your changes.

Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:

  • General steps

    • 🏆 Does this PR need to receive a label with a reputation modifier (x:size/{tiny,small,medium,large,massive})? (A medium reputation amount is awarded by default, see docs)
  • Any exercise changed

    • 👤 Does the author of the PR need to be added as an author or contributor in <exercise>/.meta/config.json (see docs)?
    • 🔬 Do the analyzer and the analyzer comments exist for this exercise? Do they need to be changed?
    • 📜 Does the design file (<exercise>/.meta/design.md) need to be updated to document new implementation decisions?
  • Concept exercise changed

    • 🌲 Do prerequisites and practices in config.json need to be updated?
    • 📖 Does the concept introduction provide all necessary information to solve this exercise?
  • Concept exercise tests changed

    • ⚪️ Are all tests un-skipped?
    • 🔢 Are all tests annotated with @tag task_id?
    • 🐈 Can all tests be understood by reading the test's block only (e.g. no module attributes, no setup functions)?

Automated comment created by PR Commenter 🤖.

github-actions[bot] avatar Aug 24 '22 14:08 github-actions[bot]

My understanding is that marking a test module as async only enables concurrent testing against other modules. The individual tests of a single module always run sequentially. 🤷‍♂️

https://hexdocs.pm/ex_unit/main/ExUnit.Case.html

zorn avatar Aug 24 '22 19:08 zorn

@zorn You're absolutely right. This existing code with the comment in the tests should never have been added:

  # run test synchronously to be able to use the same file path for all tests without write conflicts
  use ExUnit.Case, async: false

Our bad 🙈. But that also means this PR isn't really needed. We just need to remove the snippet I posted above to avoid future confusion.

angelikatyborska avatar Aug 24 '22 19:08 angelikatyborska

Hah, well TIL.

Happy to update/change the PR to remove that little snippet. Thanks to both of you.

halfdan avatar Aug 25 '22 08:08 halfdan

Happy to update/change the PR to remove that little snippet

That would be much appreciated!

angelikatyborska avatar Aug 25 '22 11:08 angelikatyborska

@halfdan are you still interested in finishing this PR? We can add the hacktoberfest label to it if you're interested.

jiegillet avatar Oct 05 '22 12:10 jiegillet

Yep, still happy to finish this. The tag would be a nice perk.

halfdan avatar Oct 06 '22 20:10 halfdan

@jiegillet Perfectly fine - sorry for dropping the ball here.

halfdan avatar Jan 31 '23 10:01 halfdan