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

fix: flaky volunteers & supervisors system specs #6006

Conversation

thejonroberts
Copy link
Contributor

What github issue is this PR for, if any?

No issue -- I have seen this spec cause failures locally and in CI.

What changed, and why?

spec/system/volunteers/index_spec.rb :55 & :400 were the most common failures, roughly 90% of my local runs I would guess. I was running specs in 'defined' order, not random, and I think it was happening more consistently that way.

I ran some rubocop-capybara auto fixes while troubleshooting - figured I may as well leave those changes in for good measure.

It seems like the travel_to calls were the major culprit. Adding travel_backs helped, but I do not see why they are necessary, so I just removed them. The other major issue was the sign_out -> visit -> sign_in -> visit sequence, the spec would get kicked out to the sign in page. I changed the sequence to a refresh call. I think a page refresh still properly tests the feature?

@github-actions github-actions bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Aug 24, 2024
Copy link
Collaborator

@elasticspoon elasticspoon left a comment

Choose a reason for hiding this comment

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

Looks reasonable. Should we just add rubocop-capybara to the app? I personally often mess up the to_not have_x vs to have_no_x

@thejonroberts
Copy link
Contributor Author

thejonroberts commented Aug 26, 2024

Looks reasonable. Should we just add rubocop-capybara to the app? I personally often mess up the to_not have_x vs to have_no_x

Yes, I think that would be great to add! I always always have to double check things like that. So I have it as a global gem for my IDE.

I'm not sure how to hook that up with standardrb, but I I could poke around this week. I do know you can use standard via rubocop, so that is an option.

I also think standard-rails/rubocop-rails would be great to add. I actually implemented it earlier this week, but I didn't want to overwhelm you 😆 . Here's a PR for standard-rails if you're curious. -- I think it's just too much change at the moment.

@elasticspoon elasticspoon merged commit 1a2180d into rubyforgood:main Aug 26, 2024
17 checks passed
@thejonroberts thejonroberts deleted the flaky-system-volunteers-index-spec branch August 30, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code Tests! 🎉💖👏
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants