debian-mirror-gitlab/debian/tests/todo/initializers

68 lines
4.9 KiB
Text
Raw Normal View History

2016-09-16 22:03:12 +05:30
$ DB=postgres sudo -u gitlab -E -H bundle exec rspec spec/initializers/
6_validations_spec.rb settings_spec.rb
secret_token_spec.rb trusted_proxies_spec.rb
pravi@nishumbha:/usr/share/gitlab$ DB=postgres sudo -u gitlab -E -H bundle exec rspec spec/initializers/
[sudo] password for pravi:
Error deleting useless .secret file: Permission denied @ unlink_internal - /usr/share/gitlab/.secret
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from block (2 levels) in <class:Railtie> at /usr/lib/ruby/vendor_ruby/sass/rails/railtie.rb:57)
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from block (2 levels) in <class:Railtie> at /usr/lib/ruby/vendor_ruby/sass/rails/railtie.rb:58)
Error deleting useless .secret file: Permission denied @ unlink_internal - /usr/share/gitlab/.secret
..............F....FF.........
Failures:
1) create_tokens setting secret_key_base and otp_key_base when the other secrets all exist when secret_key_base and otp_key_base do not exist uses the file secret
Failure/Error: expect(new_secrets['db_key_base']).to eq('db_key_base')
expected: "db_key_base"
got: nil
(compared using ==)
# ./spec/initializers/secret_token_spec.rb:136:in `block (6 levels) in <top (required)>'
# ./config/initializers/secret_token.rb:84:in `write_secrets_yml'
# ./config/initializers/secret_token.rb:31:in `create_tokens'
# ./spec/initializers/secret_token_spec.rb:139:in `block (5 levels) in <top (required)>'
2) create_tokens setting secret_key_base and otp_key_base when db_key_base is blank but exists in secrets.yml warns about the blank value existing in secrets.yml and exits
Failure/Error:
expect(self).to receive(:warn) do |warning|
expect(warning).to include('db_key_base')
expect(warning).to include('<%= an_erb_expression %>')
end
(#<RSpec::ExampleGroups::CreateTokens::SettingSecretKeyBaseAndOtpKeyBase::WhenDbKeyBaseIsBlankButExistsInSecretsYml:0x0000000ebe43b8>).warn(*(any args))
expected: 1 time with any arguments
received: 0 times with any arguments
# ./spec/initializers/secret_token_spec.rb:184:in `block (4 levels) in <top (required)>'
3) create_tokens setting secret_key_base and otp_key_base when db_key_base is blank but exists in secrets.yml does not update secrets.yml
Failure/Error: expect { create_tokens }.to raise_error(SystemExit)
expected SystemExit, got #<RSpec::Mocks::MockExpectationError: (File (class)).write("config/secrets.yml", "---\ntest:\n otp_key_base: otp_key_base\n secret_key_base: secret_key_base\n db_key_base: \"<%= an_erb_expression %>\"\nproduction:\n db_key_base: c0ee30ba71733e9d3524f8ab03e0018524bc7a67cb5fce8847b3071758c333de28cd847b2fc7f9a476ddbf92ce52c2d38015e1e91a1ae272fc08c4198035d2e4\n", {:mode=>"w", :perm=>384})
expected: 0 times with any arguments
received: 1 time with arguments: ("config/secrets.yml", "---\ntest:\n otp_key_base: otp_key_base\n secret_key_base: secret_key_base\n db_key_base: \"<%= an_erb_expression %>\"\nproduction:\n db_key_base: c0ee30ba71733e9d3524f8ab03e0018524bc7a67cb5fce8847b3071758c333de28cd847b2fc7f9a476ddbf92ce52c2d38015e1e91a1ae272fc08c4198035d2e4\n", {:mode=>"w", :perm=>384})> with backtrace:
# ./config/initializers/secret_token.rb:84:in `write_secrets_yml'
# ./config/initializers/secret_token.rb:31:in `create_tokens'
# ./spec/initializers/secret_token_spec.rb:196:in `block (5 levels) in <top (required)>'
# ./spec/initializers/secret_token_spec.rb:196:in `block (4 levels) in <top (required)>'
# ./spec/initializers/secret_token_spec.rb:196:in `block (4 levels) in <top (required)>'
Finished in 23.38 seconds (files took 8.94 seconds to load)
30 examples, 3 failures
Failed examples:
rspec ./spec/initializers/secret_token_spec.rb:130 # create_tokens setting secret_key_base and otp_key_base when the other secrets all exist when secret_key_base and otp_key_base do not exist uses the file secret
rspec ./spec/initializers/secret_token_spec.rb:183 # create_tokens setting secret_key_base and otp_key_base when db_key_base is blank but exists in secrets.yml warns about the blank value existing in secrets.yml and exits
rspec ./spec/initializers/secret_token_spec.rb:192 # create_tokens setting secret_key_base and otp_key_base when db_key_base is blank but exists in secrets.yml does not update secrets.yml