Authentication protected app issue
Closed this issue · 5 comments
I have an application where the root path is a page with omniauth-crowd authentication. Because of this, call_app fails with
Bad request: <html><body>You are being <a href="http://example.org/auth/crowd/">redirected</a>.</body></html>
Should it really consider a redirect a failure?
Probably not, here's the relevant lines:
https://github.com/schneems/derailed_benchmarks/blob/master/lib/derailed_benchmarks/tasks.rb#L62
and
https://github.com/schneems/derailed_benchmarks/blob/master/lib/derailed_benchmarks/tasks.rb#L57
I added that because i was making a ton of requests to a bad URL by accident. Guess any 2xx request should be considered success. After that, we can't really assume. Maybe make it user-set-able. How does something like that sound to you?
DerailedBenchmarks.config do |config|
config.acceptable_status_codes = [301, 302]
end
That feels weirdly specific for what this gem is trying to do, maybe? Should benchmarking know about acceptable status codes? What if I could just provide some sort of environment variable like IGNORE_BAD_REQUEST=1 .
You can now perform some benchmarking without having to boot your app. Check the readme for more info. I still haven't addressed this specific issue. Not 100% sure the best way to move forwards
You can test with an authenticated endpoint now.