RFC: Opt-out for rails deprecations in plugin tests

Hello,

we are suffering from failures in discovery plugin test suite which are caused by rails deprecations. It fails across Ruby versions and I am unable to reproduce locally:

http://ci.theforeman.org/job/test_plugin_matrix/5167/

I’d like to propose to change Rails deprecations setting raise to silence for core tests when running in plugin job. The thing is, the purpose of plugin test suite is to test plugin and regressions in core tests when plugin is enabled and not to track changes in deprecations. The main problem is that when Rails upgrade is ongoing, jenkins plugin test suite is unusable.

This could be an environmental variable in config/initializers/deprecations.rb file and the jenkins job could set it for all core unit/integration tests.

I think I don’t understand how as_deprecation_tracker works and why I see core failures. In the initializer, I see that we set config.active_support.deprecation = :stderr while tests are failing. I am trying to copy config/as_deprecation_whitelist.yaml from @mmoll 's branch/test.

https://github.com/theforeman/foreman_discovery/pull/426

I wonder, if we silence deprecation warning, will we fix them in time or will we break when upgrading to next rails version?

I propose disabling them only for plugin test job - so core suite (test_develop) would still error out. No change there, that would work as expected today via as_deprecation_tracker.