Skip to content

Conversation

@ityonemo
Copy link
Contributor

@ityonemo ityonemo commented Oct 5, 2024

this enhancement adds a test_pid field into the test context metadata. This is useful for backtracking which test is responsible when a ecto sandbox or mox allowance has triggered after the parent test has finished. For now, one will have to write a custom ExUnit.Formatter to take advantage of this extra metadata.

Copy link
Member

@josevalim josevalim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Please run the formatter and add tests. :)

Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
@josevalim
Copy link
Member

@ityonemo ping in case it fell through the cracks. :)

@axelson
Copy link
Contributor

axelson commented Nov 7, 2024

@ityonemo I've added a test case at ityonemo#1

I'd love for this to go through so I can use it to print out richer information about sandbox/allowance failures from a custom ex_unit formatter!

@josevalim josevalim closed this in 8ed104d Nov 7, 2024
@josevalim
Copy link
Member

Thank you @axelson! Looking at the test you added, I think it would be much simpler to test_pid at the beginning, simpler to use and to test too, so I pushed this change. Thank you both!

@axelson
Copy link
Contributor

axelson commented Nov 8, 2024

Nice! Thank you José!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants