Connecting rspec profiler results via URL no longer works
I removed the RSPEC_PROFILING_POSTGRES_URL
variable from the CI/CD pipelines variable in CE and EE because specs were failing hard on the setup step:
https://gitlab.com/gitlab-org/gitlab-ce/builds/15786192
$ bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init'
WARNING: This version of GitLab depends on gitlab-shell 5.0.3, but you're running Unknown. Please update gitlab-shell.
/builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/connection_specification.rb:248:in `resolve_symbol_connection': '' database is not configured. Available: ["production", "development", "staging", "test"] (ActiveRecord::AdapterNotSpecified)
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/connection_specification.rb:211:in `resolve_connection'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/connection_specification.rb:139:in `resolve'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_adapters/connection_specification.rb:169:in `spec'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/activerecord-4.2.8/lib/active_record/connection_handling.rb:50:in `establish_connection'
from /builds/gitlab-org/gitlab-ce/config/initializers/rspec_profiling.rb:4:in `establish_connection'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/rspec_profiling-0.0.5/lib/rspec_profiling/collectors/psql.rb:21:in `initialize'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/rspec_profiling-0.0.5/lib/rspec_profiling/rspec.rb:4:in `new'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/rspec_profiling-0.0.5/lib/rspec_profiling/rspec.rb:4:in `block in <top (required)>'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/rspec-core-3.5.0/lib/rspec/core.rb:97:in `configure'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/rspec_profiling-0.0.5/lib/rspec_profiling/rspec.rb:3:in `<top (required)>'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
from /builds/gitlab-org/gitlab-ce/vendor/ruby/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
from /builds/gitlab-org/gitlab-ce/spec/spec_helper.rb:21:in `<top (required)>'
from -e:1:in `require'
from -e:1:in `<main>'
ERROR: Job failed: exit code 1
You can reproduce this by setting a postgresql://
URL as RSPEC_PROFILING_POSTGRES_URL
and running any spec.
I'm not quite sure what changed that suddenly broke this. We have been using ActiveRecord 4.2.8 for quite some time.
Related issue: https://github.com/rails/rails/issues/14495
The error message suggests we have to move this database configuration into database.yml
and then reference the connection that way.
/cc: @nick.thomas, @rymai, @lbennett, @jschatz1