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
Delegate child session assertions to parent session #32143
Delegate child session assertions to parent session #32143
Conversation
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review. Please see the contribution instructions for more information. |
fadac84
to
6ebf151
Compare
6ebf151
to
7b33682
Compare
@rafaelfranca I've made the changes you requested. Let me know what you think, and I can squash the commits down. |
fc337ec
to
bc8156c
Compare
7afeff0
to
4fabf25
Compare
I found myself working on some integration tests and realized this never shipped 😅
|
I think we should make sure all of them work. |
`IntegrationTest#open_session` uses `dup` to create the new session, which meant it had its own copy of `@assertions`. This prevented the assertions from being correctly counted and reported. Child sessions now have their `attr_accessor` overriden to delegate to the root session.
4fabf25
to
affe3e2
Compare
I did some experimenting, and it turns out I was wrong about all those variables. As far as I can tell, they're defined on the report, not the test itself. The only relevant instance variables are
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Delegate child session assertions to parent session
Delegate child session assertions to parent session
Summary
This fixes #32142, in which assertions made in sub-sessions in
ActionDispatch::IntegrationTest
are not counted in the test run report.By overriding the
assertions
accessor methods on the child session to use the parent'sassertions
, the count is accurately tracked.Other Information
cc. @aud