Commit e7154898 authored by Douwe Maan's avatar Douwe Maan

Setup license in test env.

parent 5a14f5a4
...@@ -19,6 +19,8 @@ module TestEnv ...@@ -19,6 +19,8 @@ module TestEnv
# See gitlab.yml.example test section for paths # See gitlab.yml.example test section for paths
# #
def init(opts = {}) def init(opts = {})
setup_license
# Disable mailer for spinach tests # Disable mailer for spinach tests
disable_mailer if opts[:mailer] == false disable_mailer if opts[:mailer] == false
...@@ -41,6 +43,14 @@ module TestEnv ...@@ -41,6 +43,14 @@ module TestEnv
allow_any_instance_of(NotificationService).to receive(:mailer).and_call_original allow_any_instance_of(NotificationService).to receive(:mailer).and_call_original
end end
def setup_license
Gitlab::License.encryption_key = OpenSSL::PKey::RSA.generate(2048)
gl_license = Gitlab::License.new(issued_at: Date.today, licensee: { "Name" => "GitLab Test Env" })
License.create(data: gl_license.export)
end
# Clean /tmp/tests # Clean /tmp/tests
# #
# Keeps gitlab-shell and gitlab-test # Keeps gitlab-shell and gitlab-test
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment