The discussion revolves around issues with the search_spec.rb test in Discourse’s RSpec tests. Mittineague initially encountered 30 test failures and then 7 after running database migrations. Some failures were due to “RateLimiter LimitExceeded” errors, which Mittineague was under the impression should be exempt in testing.
zogstrip suggested flushing Redis and using rake autospec to run tests. cpradio questioned the use of autospec, but zogstrip explained its benefits, including automatic re-running of failed tests.
After trying autospec, cpradio encountered a dozen failures, including three related to Search. zogstrip suspected a possible issue with the database locale. cpradio mentioned following the Discourse installation guide, which didn’t cover locale settings.
I was getting things set up to do a PR - Pull Request - and figured it might be nice to include a test.
So I ran bundle exec rspec spec/components/search_spec.rb
and got “38 examples, 30 failures” - Ouch!
* my change didn’t add any Fails, but then it didn’t remove any either
Doesn’t that run every test? Sometimes it is nice to be able to run the ones you know you are affecting or are throwing errors to help nail things down.
Does autospec do something to help increase ratelimits?
It does, but it’s clever enough to watch the files and stop what it’s currently doing to run the tests associated with the file you just saved And it will automatically keep re-trying the same tests until they’re green. Huge time saver since you don’t have to wait for rails to launch every time!
Hmm… Okay, with that in mind though, I think it doesn’t like me or it may not like my setup, as I tried it after wiping the discourse_test database, and re-seeding that database, and it gets about a dozen failures.
3 are related to Search
rspec ./spec/components/search_spec.rb:68 # Search escapes non alphanumeric characters
rspec ./spec/components/search_spec.rb:429 # Search Advanced search supports before and after in:first user:
rspec ./spec/components/search_spec.rb:485 # Search Advanced search can find by status
So I guess I’ll have to spend some time to figure out why this is happening, when I get a chance.