diff --git a/spec/lib/ci/ansi2html_spec.rb b/spec/lib/ci/ansi2html_spec.rb
index 75c023bbc43c5c2bc242582c164db1f0946563be..3a2b568f4c7ca21d2c4eef8d0e8268b9c2408645 100644
--- a/spec/lib/ci/ansi2html_spec.rb
+++ b/spec/lib/ci/ansi2html_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Ci::Ansi2html do
+describe Ci::Ansi2html, lib: true do
   subject { Ci::Ansi2html }
 
   it "prints non-ansi as-is" do
diff --git a/spec/lib/ci/charts_spec.rb b/spec/lib/ci/charts_spec.rb
index 83e2ad220b832995607ea94d86ee3a023704d386..50a77308cde81d48d3d2df677dc04964f9cb9c4c 100644
--- a/spec/lib/ci/charts_spec.rb
+++ b/spec/lib/ci/charts_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe "Charts" do
+describe Ci::Charts, lib: true do
 
   context "build_times" do
     before do
diff --git a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
index 6f287719ba61c84c519b566b5ede3e685a6b7fe6..ce4a5244bd0c2af4138c88f8e9887189217fd1e9 100644
--- a/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+++ b/spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Ci
-  describe GitlabCiYamlProcessor do
+  describe GitlabCiYamlProcessor, lib: true do
     let(:path) { 'path' }
     
     describe "#builds_for_ref" do
diff --git a/spec/lib/disable_email_interceptor_spec.rb b/spec/lib/disable_email_interceptor_spec.rb
index a9624e9a2b76efd36b7946f083b04dcda1877786..c2a7b20b84d90b8f3ec914dd0284a256ae709785 100644
--- a/spec/lib/disable_email_interceptor_spec.rb
+++ b/spec/lib/disable_email_interceptor_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe DisableEmailInterceptor do
+describe DisableEmailInterceptor, lib: true do
   before do
     ActionMailer::Base.register_interceptor(DisableEmailInterceptor)
   end
diff --git a/spec/lib/extracts_path_spec.rb b/spec/lib/extracts_path_spec.rb
index 48bc60eed16f0d86c611c9333f83c4acb5d1e095..f38fadda9babb3099d2338bb4e33fe1bb7bafb98 100644
--- a/spec/lib/extracts_path_spec.rb
+++ b/spec/lib/extracts_path_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe ExtractsPath do
+describe ExtractsPath, lib: true do
   include ExtractsPath
   include RepoHelpers
   include Gitlab::Application.routes.url_helpers
diff --git a/spec/lib/file_size_validator_spec.rb b/spec/lib/file_size_validator_spec.rb
index 12ccc051c74865489fece6fe855ba92182ec2b73..fda6f9a6c885294c78247fb06b33dcba3da332c1 100644
--- a/spec/lib/file_size_validator_spec.rb
+++ b/spec/lib/file_size_validator_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe 'Gitlab::FileSizeValidatorSpec' do
+describe FileSizeValidator, lib: true do
   let(:validator) { FileSizeValidator.new(options) }
   let(:attachment) { AttachmentUploader.new }
   let(:note) { create(:note) }
diff --git a/spec/lib/git_ref_validator_spec.rb b/spec/lib/git_ref_validator_spec.rb
index 4633b6f3934b9ddf7e00c1cf3ea35e10d3da9f57..dc57e94f193b0e5992c4f3ee0e193c5842d95be7 100644
--- a/spec/lib/git_ref_validator_spec.rb
+++ b/spec/lib/git_ref_validator_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::GitRefValidator do
+describe Gitlab::GitRefValidator, lib: true do
   it { expect(Gitlab::GitRefValidator.validate('feature/new')).to be_truthy }
   it { expect(Gitlab::GitRefValidator.validate('implement_@all')).to be_truthy }
   it { expect(Gitlab::GitRefValidator.validate('my_new_feature')).to be_truthy }
diff --git a/spec/lib/gitlab/asciidoc_spec.rb b/spec/lib/gitlab/asciidoc_spec.rb
index 03e36fd35524ab596b9778cfd84c6434e40b6c6d..7d985fb6f1e820cb7e75d788fe2dafc91f589a43 100644
--- a/spec/lib/gitlab/asciidoc_spec.rb
+++ b/spec/lib/gitlab/asciidoc_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
 require 'nokogiri'
 
 module Gitlab
-  describe Asciidoc do
+  describe Asciidoc, lib: true do
 
     let(:input) { '<b>ascii</b>' }
     let(:context) { {} }
diff --git a/spec/lib/gitlab/auth_spec.rb b/spec/lib/gitlab/auth_spec.rb
index 72806bebe1f033e095bc6f1a5395c49712a6d1e7..aad291c03cdc33cea28019b56bce7e436b29ccde 100644
--- a/spec/lib/gitlab/auth_spec.rb
+++ b/spec/lib/gitlab/auth_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Auth do
+describe Gitlab::Auth, lib: true do
   let(:gl_auth) { Gitlab::Auth.new }
 
   describe :find do
diff --git a/spec/lib/gitlab/backend/grack_auth_spec.rb b/spec/lib/gitlab/backend/grack_auth_spec.rb
index dfa0e10318a3ca1d01146ec3221992485a510892..73458735ad97ff81f9968ba5d8d8181b826092ef 100644
--- a/spec/lib/gitlab/backend/grack_auth_spec.rb
+++ b/spec/lib/gitlab/backend/grack_auth_spec.rb
@@ -1,6 +1,6 @@
 require "spec_helper"
 
-describe Grack::Auth do
+describe Grack::Auth, lib: true do
   let(:user)    { create(:user) }
   let(:project) { create(:project) }
 
diff --git a/spec/lib/gitlab/backend/shell_spec.rb b/spec/lib/gitlab/backend/shell_spec.rb
index b60e23454d60f875ca722fca949fd1c228e98ccf..fd869f48b5c223890d58c5f85b86219212b986fb 100644
--- a/spec/lib/gitlab/backend/shell_spec.rb
+++ b/spec/lib/gitlab/backend/shell_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Shell do
+describe Gitlab::Shell, lib: true do
   let(:project) { double('Project', id: 7, path: 'diaspora') }
   let(:gitlab_shell) { Gitlab::Shell.new }
 
@@ -16,7 +16,7 @@ describe Gitlab::Shell do
 
   it { expect(gitlab_shell.url_to_repo('diaspora')).to eq(Gitlab.config.gitlab_shell.ssh_path_prefix + "diaspora.git") }
 
-  describe Gitlab::Shell::KeyAdder do
+  describe Gitlab::Shell::KeyAdder, lib: true do
     describe '#add_key' do
       it 'normalizes space characters in the key' do
         io = spy
diff --git a/spec/lib/gitlab/bitbucket_import/client_spec.rb b/spec/lib/gitlab/bitbucket_import/client_spec.rb
index dfe58637eeef8cfc994518a3512c20af2358ab95..aa0699f2ebf99634602421c3118c669d9a8d2ea1 100644
--- a/spec/lib/gitlab/bitbucket_import/client_spec.rb
+++ b/spec/lib/gitlab/bitbucket_import/client_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::BitbucketImport::Client do
+describe Gitlab::BitbucketImport::Client, lib: true do
   let(:token) { '123456' }
   let(:secret) { 'secret' }
   let(:client) { Gitlab::BitbucketImport::Client.new(token, secret) }
diff --git a/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb b/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
index 0e826a319e04e382d897e558a0a7085e097a2a79..e1c60e07b4d656f9b54dd7df45eac9aa69c4d191 100644
--- a/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
+++ b/spec/lib/gitlab/bitbucket_import/project_creator_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::BitbucketImport::ProjectCreator do
+describe Gitlab::BitbucketImport::ProjectCreator, lib: true do
   let(:user) { create(:user) }
   let(:repo) do
     {
diff --git a/spec/lib/gitlab/closing_issue_extractor_spec.rb b/spec/lib/gitlab/closing_issue_extractor_spec.rb
index fe1b94a484e98ec6ca3bfbea73912e45915ed92f..99288da1e43f32479bfc6bc7dad7e28ea4a2681c 100644
--- a/spec/lib/gitlab/closing_issue_extractor_spec.rb
+++ b/spec/lib/gitlab/closing_issue_extractor_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::ClosingIssueExtractor do
+describe Gitlab::ClosingIssueExtractor, lib: true do
   let(:project)   { create(:project) }
   let(:project2)   { create(:project) }
   let(:issue)     { create(:issue, project: project) }
diff --git a/spec/lib/gitlab/color_schemes_spec.rb b/spec/lib/gitlab/color_schemes_spec.rb
index c7be45dbcd3f84368cd7de04e48a6222e7894061..0a1ec66f1999bd59f5f3c226f3167808a94fb4f6 100644
--- a/spec/lib/gitlab/color_schemes_spec.rb
+++ b/spec/lib/gitlab/color_schemes_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::ColorSchemes do
+describe Gitlab::ColorSchemes, lib: true do
   describe '.body_classes' do
     it 'returns a space-separated list of class names' do
       css = described_class.body_classes
diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb
index 7cdebdf209aa540ba73e8f075491e20518167680..8461e8ce50d6c3dbf4a2cfbea877f3a6052a6a04 100644
--- a/spec/lib/gitlab/database_spec.rb
+++ b/spec/lib/gitlab/database_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Database do
+describe Gitlab::Database, lib: true do
   # These are just simple smoke tests to check if the methods work (regardless
   # of what they may return).
   describe '.mysql?' do
diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb
index 8b7946f3117269ec0edefea673971b5473f39985..c7cdf8691d61b37217bb47dd61439aa47dcb101c 100644
--- a/spec/lib/gitlab/diff/file_spec.rb
+++ b/spec/lib/gitlab/diff/file_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Diff::File do
+describe Gitlab::Diff::File, lib: true do
   include RepoHelpers
 
   let(:project) { create(:project) }
diff --git a/spec/lib/gitlab/diff/parser_spec.rb b/spec/lib/gitlab/diff/parser_spec.rb
index 4d5d1431683f8995c348494f8b180d77a4429a01..ba577bd28e5fa4bb1d0381376bc0a46a55341b3e 100644
--- a/spec/lib/gitlab/diff/parser_spec.rb
+++ b/spec/lib/gitlab/diff/parser_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Diff::Parser do
+describe Gitlab::Diff::Parser, lib: true do
   include RepoHelpers
 
   let(:project) { create(:project) }
diff --git a/spec/lib/gitlab/email/attachment_uploader_spec.rb b/spec/lib/gitlab/email/attachment_uploader_spec.rb
index 8fb432367b63ddc603ca6b128f88537c7d6b9c7b..476a21bf996c298a5b5a291a9e477c802ccf0a1c 100644
--- a/spec/lib/gitlab/email/attachment_uploader_spec.rb
+++ b/spec/lib/gitlab/email/attachment_uploader_spec.rb
@@ -1,6 +1,6 @@
 require "spec_helper"
 
-describe Gitlab::Email::AttachmentUploader do
+describe Gitlab::Email::AttachmentUploader, lib: true do
   describe "#execute" do
     let(:project) { build(:project) }
     let(:message_raw) { fixture_file("emails/attachment.eml") }
diff --git a/spec/lib/gitlab/email/receiver_spec.rb b/spec/lib/gitlab/email/receiver_spec.rb
index e470b7cd5f54a2f287cc1dee9defd8b038ca9b9a..b535413bbd4bfca3784dc1e5dd7c3c59987261d4 100644
--- a/spec/lib/gitlab/email/receiver_spec.rb
+++ b/spec/lib/gitlab/email/receiver_spec.rb
@@ -1,6 +1,6 @@
 require "spec_helper"
 
-describe Gitlab::Email::Receiver do
+describe Gitlab::Email::Receiver, lib: true do
   before do
     stub_incoming_email_setting(enabled: true, address: "reply+%{key}@appmail.adventuretime.ooo")
   end
diff --git a/spec/lib/gitlab/email/reply_parser_spec.rb b/spec/lib/gitlab/email/reply_parser_spec.rb
index 7cae1da8050053015c868791c5f1380ecdf724c3..6f8e9a4be6413c3d112dd74f3694fbbb9a6d818b 100644
--- a/spec/lib/gitlab/email/reply_parser_spec.rb
+++ b/spec/lib/gitlab/email/reply_parser_spec.rb
@@ -1,7 +1,7 @@
 require "spec_helper"
 
 # Inspired in great part by Discourse's Email::Receiver
-describe Gitlab::Email::ReplyParser do
+describe Gitlab::Email::ReplyParser, lib: true do
   describe '#execute' do
     def test_parse_body(mail_string)
       described_class.new(Mail::Message.new(mail_string)).execute
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
index c7291689e320b1d75d9c0aa83043891094b4481a..9b3a0e3a75fab280ea5a94406ec79c68d6963eee 100644
--- a/spec/lib/gitlab/git_access_spec.rb
+++ b/spec/lib/gitlab/git_access_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::GitAccess do
+describe Gitlab::GitAccess, lib: true do
   let(:access) { Gitlab::GitAccess.new(actor, project) }
   let(:project) { create(:project) }
   let(:user) { create(:user) }
diff --git a/spec/lib/gitlab/git_access_wiki_spec.rb b/spec/lib/gitlab/git_access_wiki_spec.rb
index 4cb91094cb3bf0bda9ff4352a3a4237e9c90d089..77ecfce6f17f01eee7f8fcc938408efaa5ae11fe 100644
--- a/spec/lib/gitlab/git_access_wiki_spec.rb
+++ b/spec/lib/gitlab/git_access_wiki_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::GitAccessWiki do
+describe Gitlab::GitAccessWiki, lib: true do
   let(:access) { Gitlab::GitAccessWiki.new(user, project) }
   let(:project) { create(:project) }
   let(:user) { create(:user) }
diff --git a/spec/lib/gitlab/github_import/client_spec.rb b/spec/lib/gitlab/github_import/client_spec.rb
index 26618120316ace4d5aef3ddf6eab3f5b7d546a21..49d8cdf43140db03df71ce67d7fc2332593217a4 100644
--- a/spec/lib/gitlab/github_import/client_spec.rb
+++ b/spec/lib/gitlab/github_import/client_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::GithubImport::Client do
+describe Gitlab::GithubImport::Client, lib: true do
   let(:token) { '123456' }
   let(:client) { Gitlab::GithubImport::Client.new(token) }
 
diff --git a/spec/lib/gitlab/github_import/project_creator_spec.rb b/spec/lib/gitlab/github_import/project_creator_spec.rb
index ca61d3c5234e93902ff70c74155a935d671d6cea..c93a3ebdaeccef652ade6ce67732b54893c38e5d 100644
--- a/spec/lib/gitlab/github_import/project_creator_spec.rb
+++ b/spec/lib/gitlab/github_import/project_creator_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::GithubImport::ProjectCreator do
+describe Gitlab::GithubImport::ProjectCreator, lib: true do
   let(:user) { create(:user) }
   let(:repo) do
     OpenStruct.new(
diff --git a/spec/lib/gitlab/gitlab_import/client_spec.rb b/spec/lib/gitlab/gitlab_import/client_spec.rb
index c511c51547409ac98519b97c4b4de59159c4d139..e6831e7c3832ba535cb0059c3c009e094cc19851 100644
--- a/spec/lib/gitlab/gitlab_import/client_spec.rb
+++ b/spec/lib/gitlab/gitlab_import/client_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::GitlabImport::Client do
+describe Gitlab::GitlabImport::Client, lib: true do
   let(:token) { '123456' }
   let(:client) { Gitlab::GitlabImport::Client.new(token) }
 
diff --git a/spec/lib/gitlab/gitlab_import/project_creator_spec.rb b/spec/lib/gitlab/gitlab_import/project_creator_spec.rb
index 2d8923d14bb94309436fe65b92c49793accd2884..483f65cd0530576a0c2668d3049a856a30167bcd 100644
--- a/spec/lib/gitlab/gitlab_import/project_creator_spec.rb
+++ b/spec/lib/gitlab/gitlab_import/project_creator_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::GitlabImport::ProjectCreator do
+describe Gitlab::GitlabImport::ProjectCreator, lib: true do
   let(:user) { create(:user) }
   let(:repo) do
     {
diff --git a/spec/lib/gitlab/gitorious_import/project_creator_spec.rb b/spec/lib/gitlab/gitorious_import/project_creator_spec.rb
index c1125ca63574849b61f7112480ab9e45cd731a52..946712ca38eb9dfdcacfc3f1382f8e63afe3a751 100644
--- a/spec/lib/gitlab/gitorious_import/project_creator_spec.rb
+++ b/spec/lib/gitlab/gitorious_import/project_creator_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::GitoriousImport::ProjectCreator do
+describe Gitlab::GitoriousImport::ProjectCreator, lib: true do
   let(:user) { create(:user) }
   let(:repo) { Gitlab::GitoriousImport::Repository.new('foo/bar-baz-qux') }
   let(:namespace){ create(:group, owner: user) }
diff --git a/spec/lib/gitlab/google_code_import/client_spec.rb b/spec/lib/gitlab/google_code_import/client_spec.rb
index 37985c062b4a06858c6911433b59df08f2f80cfd..85949ae8dc492bd5e6be44f98d48d0d2383c3462 100644
--- a/spec/lib/gitlab/google_code_import/client_spec.rb
+++ b/spec/lib/gitlab/google_code_import/client_spec.rb
@@ -1,6 +1,6 @@
 require "spec_helper"
 
-describe Gitlab::GoogleCodeImport::Client do
+describe Gitlab::GoogleCodeImport::Client, lib: true do
   let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) }
   subject { described_class.new(raw_data) }
 
diff --git a/spec/lib/gitlab/google_code_import/importer_spec.rb b/spec/lib/gitlab/google_code_import/importer_spec.rb
index 65ad7524cc2b6fa8339a2069e3c22c1b16de4025..647631271e0004725cf22834897ce7d15ccb6d39 100644
--- a/spec/lib/gitlab/google_code_import/importer_spec.rb
+++ b/spec/lib/gitlab/google_code_import/importer_spec.rb
@@ -1,6 +1,6 @@
 require "spec_helper"
 
-describe Gitlab::GoogleCodeImport::Importer do
+describe Gitlab::GoogleCodeImport::Importer, lib: true do
   let(:mapped_user) { create(:user, username: "thilo123") }
   let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) }
   let(:client) { Gitlab::GoogleCodeImport::Client.new(raw_data) }
diff --git a/spec/lib/gitlab/google_code_import/project_creator_spec.rb b/spec/lib/gitlab/google_code_import/project_creator_spec.rb
index 35549b48687a2832fe7985b8ed05e9acfa860b48..499a896ee7697633d98cb60659a3fd43358ac122 100644
--- a/spec/lib/gitlab/google_code_import/project_creator_spec.rb
+++ b/spec/lib/gitlab/google_code_import/project_creator_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::GoogleCodeImport::ProjectCreator do
+describe Gitlab::GoogleCodeImport::ProjectCreator, lib: true do
   let(:user) { create(:user) }
   let(:repo) do
     Gitlab::GoogleCodeImport::Repository.new(
diff --git a/spec/lib/gitlab/incoming_email_spec.rb b/spec/lib/gitlab/incoming_email_spec.rb
index 5fdb9c723b1df95b4fbbdff1a9171e939b45ecff..bcdba8d4c1220d1d0d0aa25f6def9a2f3020ca30 100644
--- a/spec/lib/gitlab/incoming_email_spec.rb
+++ b/spec/lib/gitlab/incoming_email_spec.rb
@@ -1,6 +1,6 @@
 require "spec_helper"
 
-describe Gitlab::IncomingEmail do
+describe Gitlab::IncomingEmail, lib: true do
   describe "self.enabled?" do
     context "when reply by email is enabled" do
       before do
diff --git a/spec/lib/gitlab/inline_diff_spec.rb b/spec/lib/gitlab/inline_diff_spec.rb
index 2e0a05088ccb052f9a49286fbd04f97035db0a1b..c690c195112fd8e7fa173c060b3858c24134a0fa 100644
--- a/spec/lib/gitlab/inline_diff_spec.rb
+++ b/spec/lib/gitlab/inline_diff_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::InlineDiff do
+describe Gitlab::InlineDiff, lib: true do
   describe '#processing' do
     let(:diff) do
       <<eos
diff --git a/spec/lib/gitlab/key_fingerprint_spec.rb b/spec/lib/gitlab/key_fingerprint_spec.rb
index 266eab6e7932351a7372795cb29fdcc24f4eeefe..d09f51f3bfc2569f1f8713ee0f676ae7900bf912 100644
--- a/spec/lib/gitlab/key_fingerprint_spec.rb
+++ b/spec/lib/gitlab/key_fingerprint_spec.rb
@@ -1,6 +1,6 @@
 require "spec_helper"
 
-describe Gitlab::KeyFingerprint do
+describe Gitlab::KeyFingerprint, lib: true do
   let(:key)         { "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" }
   let(:fingerprint) { "3f:a2:ee:de:b5:de:53:c3:aa:2f:9c:45:24:4c:47:7b" }
 
diff --git a/spec/lib/gitlab/ldap/access_spec.rb b/spec/lib/gitlab/ldap/access_spec.rb
index 960547a0ad78db2fa0438a9955b6e99ba40ccd8d..a628d0c01574fb3ad8371f361d46809e6565111c 100644
--- a/spec/lib/gitlab/ldap/access_spec.rb
+++ b/spec/lib/gitlab/ldap/access_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::LDAP::Access do
+describe Gitlab::LDAP::Access, lib: true do
   let(:access) { Gitlab::LDAP::Access.new user }
   let(:user) { create(:omniauth_user) }
 
diff --git a/spec/lib/gitlab/ldap/adapter_spec.rb b/spec/lib/gitlab/ldap/adapter_spec.rb
index 38076602df93d0d689d3e109007b383926f295f0..4847b5f3b0e62e724e36459ee28ffd7c04f909e0 100644
--- a/spec/lib/gitlab/ldap/adapter_spec.rb
+++ b/spec/lib/gitlab/ldap/adapter_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::LDAP::Adapter do
+describe Gitlab::LDAP::Adapter, lib: true do
   let(:adapter) { Gitlab::LDAP::Adapter.new 'ldapmain' }
 
   describe '#dn_matches_filter?' do
diff --git a/spec/lib/gitlab/ldap/auth_hash_spec.rb b/spec/lib/gitlab/ldap/auth_hash_spec.rb
index 7d8268536a4b2a8ed6405ab6590bcfa353772759..6a53ed1db64019ddc289cbb392a108b8a24630a3 100644
--- a/spec/lib/gitlab/ldap/auth_hash_spec.rb
+++ b/spec/lib/gitlab/ldap/auth_hash_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::LDAP::AuthHash do
+describe Gitlab::LDAP::AuthHash, lib: true do
   let(:auth_hash) do
     Gitlab::LDAP::AuthHash.new(
       OmniAuth::AuthHash.new(
diff --git a/spec/lib/gitlab/ldap/authentication_spec.rb b/spec/lib/gitlab/ldap/authentication_spec.rb
index 6e3de914a45fec27aa8c0d0de21df8e0db63e155..b8f3290e84c9cd4013f25900e91130f2de31b52b 100644
--- a/spec/lib/gitlab/ldap/authentication_spec.rb
+++ b/spec/lib/gitlab/ldap/authentication_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::LDAP::Authentication do
+describe Gitlab::LDAP::Authentication, lib: true do
   let(:user)     { create(:omniauth_user, extern_uid: dn) }
   let(:dn)       { 'uid=john,ou=people,dc=example,dc=com' }
   let(:login)    { 'john' }
diff --git a/spec/lib/gitlab/ldap/config_spec.rb b/spec/lib/gitlab/ldap/config_spec.rb
index 3548d647c84ae18988e21ac2ce6842d37d74ab41..835853a83a4357c30aaebf88027df0b936bf8925 100644
--- a/spec/lib/gitlab/ldap/config_spec.rb
+++ b/spec/lib/gitlab/ldap/config_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::LDAP::Config do
+describe Gitlab::LDAP::Config, lib: true do
   let(:config) { Gitlab::LDAP::Config.new provider }
   let(:provider) { 'ldapmain' }
 
diff --git a/spec/lib/gitlab/ldap/user_spec.rb b/spec/lib/gitlab/ldap/user_spec.rb
index b5b56a349526774d7f5dd98194a4e1d7092d3844..3bba5e2efa2c930c4ee406232c1e9349e72162a2 100644
--- a/spec/lib/gitlab/ldap/user_spec.rb
+++ b/spec/lib/gitlab/ldap/user_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::LDAP::User do
+describe Gitlab::LDAP::User, lib: true do
   let(:ldap_user) { Gitlab::LDAP::User.new(auth_hash) }
   let(:gl_user) { ldap_user.gl_user }
   let(:info) do
diff --git a/spec/lib/gitlab/lfs/lfs_router_spec.rb b/spec/lib/gitlab/lfs/lfs_router_spec.rb
index 5b13d65c7c06011e1846709fd64e16ceb3b5a412..5852b31ab3a5ff04b1002af9290acfcbac5b881d 100644
--- a/spec/lib/gitlab/lfs/lfs_router_spec.rb
+++ b/spec/lib/gitlab/lfs/lfs_router_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Lfs::Router do
+describe Gitlab::Lfs::Router, lib: true do
   let(:project) { create(:project) }
   let(:public_project) { create(:project, :public) }
   let(:forked_project) { fork_project(public_project, user) }
diff --git a/spec/lib/gitlab/markdown/autolink_filter_spec.rb b/spec/lib/gitlab/markdown/autolink_filter_spec.rb
index 26332ba5217f38f18d1639557bb03fccfdb1eef0..7cfec554a457d8a1e17cbb8c21be5c8853607e9d 100644
--- a/spec/lib/gitlab/markdown/autolink_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/autolink_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe AutolinkFilter do
+  describe AutolinkFilter, lib: true do
     include FilterSpecHelper
 
     let(:link) { 'http://about.gitlab.com/' }
diff --git a/spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb b/spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
index 9ce63f9af464e18f10e155e5903ada0c409397cc..6aecba5a676713a9fe6495d9410e726f6c68163c 100644
--- a/spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe CommitRangeReferenceFilter do
+  describe CommitRangeReferenceFilter, lib: true do
     include FilterSpecHelper
 
     let(:project) { create(:project, :public) }
diff --git a/spec/lib/gitlab/markdown/commit_reference_filter_spec.rb b/spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
index 462a41b47562958a43497a0aa289da384dee2ec4..9ac76b3228b6a7660591954f605e21ce82ab5e01 100644
--- a/spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe CommitReferenceFilter do
+  describe CommitReferenceFilter, lib: true do
     include FilterSpecHelper
 
     let(:project) { create(:project, :public) }
diff --git a/spec/lib/gitlab/markdown/cross_project_reference_spec.rb b/spec/lib/gitlab/markdown/cross_project_reference_spec.rb
index 8d4f9e403a603bfe37c1f6d22fa3df75f0e13dcf..e777489778053865f870d96e1456e95f4e6e2102 100644
--- a/spec/lib/gitlab/markdown/cross_project_reference_spec.rb
+++ b/spec/lib/gitlab/markdown/cross_project_reference_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe CrossProjectReference do
+  describe CrossProjectReference, lib: true do
     include described_class
 
     describe '#project_from_ref' do
diff --git a/spec/lib/gitlab/markdown/emoji_filter_spec.rb b/spec/lib/gitlab/markdown/emoji_filter_spec.rb
index 11efd9bb4cd33f36205fa7d7d02d7d018ff3f42e..fb98aac334013423ac8ab4376289e9c8bdb7685a 100644
--- a/spec/lib/gitlab/markdown/emoji_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/emoji_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe EmojiFilter do
+  describe EmojiFilter, lib: true do
     include FilterSpecHelper
 
     before do
diff --git a/spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb b/spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
index d8c2970b6bdc9a7a31b2b471b740b1f5c88a5cb0..cd92007e0478260887ecd64676750d319c4eda8c 100644
--- a/spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe ExternalIssueReferenceFilter do
+  describe ExternalIssueReferenceFilter, lib: true do
     include FilterSpecHelper
 
     def helper
diff --git a/spec/lib/gitlab/markdown/external_link_filter_spec.rb b/spec/lib/gitlab/markdown/external_link_filter_spec.rb
index a040b34577b958c033bfa8fc14d6d14877192937..493c19a287d945ab040a4d56fa6f8c26d5397834 100644
--- a/spec/lib/gitlab/markdown/external_link_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/external_link_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe ExternalLinkFilter do
+  describe ExternalLinkFilter, lib: true do
     include FilterSpecHelper
 
     it 'ignores elements without an href attribute' do
diff --git a/spec/lib/gitlab/markdown/issue_reference_filter_spec.rb b/spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
index 078ff3ed4b2de9c43050d00c4b0b34ddded492aa..dee0826336bc8e61e87ae425d2e326f8ce0ce047 100644
--- a/spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe IssueReferenceFilter do
+  describe IssueReferenceFilter, lib: true do
     include FilterSpecHelper
 
     def helper
diff --git a/spec/lib/gitlab/markdown/label_reference_filter_spec.rb b/spec/lib/gitlab/markdown/label_reference_filter_spec.rb
index ef6dd524aba51efbb71c3243eed03ff527d1376a..799dbe6f2db8abaae19af44ba3bf4060cc8d5d92 100644
--- a/spec/lib/gitlab/markdown/label_reference_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/label_reference_filter_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
 require 'html/pipeline'
 
 module Gitlab::Markdown
-  describe LabelReferenceFilter do
+  describe LabelReferenceFilter, lib: true do
     include FilterSpecHelper
 
     let(:project)   { create(:empty_project, :public) }
diff --git a/spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb b/spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
index 4a23205112714e719f9806144dcf0e1500cbe7a9..ed70d5c4fa2412e7c5d6007e24356ad53b4ac6a4 100644
--- a/spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe MergeRequestReferenceFilter do
+  describe MergeRequestReferenceFilter, lib: true do
     include FilterSpecHelper
 
     let(:project) { create(:project, :public) }
diff --git a/spec/lib/gitlab/markdown/redactor_filter_spec.rb b/spec/lib/gitlab/markdown/redactor_filter_spec.rb
index eea3f1cf370920b21d578a016a2a21fe5f3feea2..27a3d8ec4efda169f4512feb4350aa2f35410e8f 100644
--- a/spec/lib/gitlab/markdown/redactor_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/redactor_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe RedactorFilter do
+  describe RedactorFilter, lib: true do
     include ActionView::Helpers::UrlHelper
     include FilterSpecHelper
 
diff --git a/spec/lib/gitlab/markdown/reference_gatherer_filter_spec.rb b/spec/lib/gitlab/markdown/reference_gatherer_filter_spec.rb
index 4fa473ad191a0daad3bf517add4d43f16a974e73..375dd689472cd65436e7278480005b2fe746bd37 100644
--- a/spec/lib/gitlab/markdown/reference_gatherer_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/reference_gatherer_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe ReferenceGathererFilter do
+  describe ReferenceGathererFilter, lib: true do
     include ActionView::Helpers::UrlHelper
     include FilterSpecHelper
 
diff --git a/spec/lib/gitlab/markdown/relative_link_filter_spec.rb b/spec/lib/gitlab/markdown/relative_link_filter_spec.rb
index 027336ceb73026f65a0fe4951e751db486693d2b..7f193004e329c7d405582b2b74eb6203cddd892e 100644
--- a/spec/lib/gitlab/markdown/relative_link_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/relative_link_filter_spec.rb
@@ -3,7 +3,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe RelativeLinkFilter do
+  describe RelativeLinkFilter, lib: true do
     def filter(doc, contexts = {})
       contexts.reverse_merge!({
         commit:         project.commit,
diff --git a/spec/lib/gitlab/markdown/sanitization_filter_spec.rb b/spec/lib/gitlab/markdown/sanitization_filter_spec.rb
index 27cd00e80542a7da10c6e9394aafaffe7a3f863e..522481b45a5fbce19a69c8feeefd1cb796a9498a 100644
--- a/spec/lib/gitlab/markdown/sanitization_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/sanitization_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe SanitizationFilter do
+  describe SanitizationFilter, lib: true do
     include FilterSpecHelper
 
     describe 'default whitelist' do
diff --git a/spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb b/spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
index 3a9acc9d6d4b6598b79910d9d72e415883232369..279244c5ac24cf8b5d9e5ef7a0b670b2c8e38628 100644
--- a/spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe SnippetReferenceFilter do
+  describe SnippetReferenceFilter, lib: true do
     include FilterSpecHelper
 
     let(:project)   { create(:empty_project, :public) }
diff --git a/spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb b/spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb
index 6a490673728378dcac545b4e14532d2228753b34..f9be5ad2a6eac17480de0904845e01820cdc1f9e 100644
--- a/spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe SyntaxHighlightFilter do
+  describe SyntaxHighlightFilter, lib: true do
     include FilterSpecHelper
 
     it 'highlights valid code blocks' do
diff --git a/spec/lib/gitlab/markdown/table_of_contents_filter_spec.rb b/spec/lib/gitlab/markdown/table_of_contents_filter_spec.rb
index ddf583a72c12501bd059b36a94f47a07011a5a2d..8c3c6e50b75846df4f0c182b54aca893b5db5452 100644
--- a/spec/lib/gitlab/markdown/table_of_contents_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/table_of_contents_filter_spec.rb
@@ -3,7 +3,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe TableOfContentsFilter do
+  describe TableOfContentsFilter, lib: true do
     include FilterSpecHelper
 
     def header(level, text)
diff --git a/spec/lib/gitlab/markdown/task_list_filter_spec.rb b/spec/lib/gitlab/markdown/task_list_filter_spec.rb
index 94f39cc966ed55ed6903c85fd01842a19d08acae..cbcfd92956f1ad4fa4020c7bc25a668082d6816f 100644
--- a/spec/lib/gitlab/markdown/task_list_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/task_list_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe TaskListFilter do
+  describe TaskListFilter, lib: true do
     include FilterSpecHelper
 
     it 'does not apply `task-list` class to non-task lists' do
diff --git a/spec/lib/gitlab/markdown/upload_link_filter_spec.rb b/spec/lib/gitlab/markdown/upload_link_filter_spec.rb
index 9ae45a6f5597e035e11e393b5424f34fca221ce9..9087f823d7f6a018ef832d2be78602d097bcd3e0 100644
--- a/spec/lib/gitlab/markdown/upload_link_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/upload_link_filter_spec.rb
@@ -3,7 +3,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe UploadLinkFilter do
+  describe UploadLinkFilter, lib: true do
     def filter(doc, contexts = {})
       contexts.reverse_merge!({
         project: project
diff --git a/spec/lib/gitlab/markdown/user_reference_filter_spec.rb b/spec/lib/gitlab/markdown/user_reference_filter_spec.rb
index 25379f0670ef198bde870d35d9d8aacc3c307bca..3dca68edfa86142472cad65bf85a4955bb36e0c9 100644
--- a/spec/lib/gitlab/markdown/user_reference_filter_spec.rb
+++ b/spec/lib/gitlab/markdown/user_reference_filter_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 module Gitlab::Markdown
-  describe UserReferenceFilter do
+  describe UserReferenceFilter, lib: true do
     include FilterSpecHelper
 
     let(:project)   { create(:empty_project, :public) }
diff --git a/spec/lib/gitlab/markup_helper_spec.rb b/spec/lib/gitlab/markup_helper_spec.rb
index e610fab05da70e6e67ef9f8fc87624ec07539680..93b91b849f2837956970af736f15287aae7bd663 100644
--- a/spec/lib/gitlab/markup_helper_spec.rb
+++ b/spec/lib/gitlab/markup_helper_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::MarkupHelper do
+describe Gitlab::MarkupHelper, lib: true do
   describe '#markup?' do
     %w(textile rdoc org creole wiki
        mediawiki rst adoc ad asciidoc mdown md markdown).each do |type|
diff --git a/spec/lib/gitlab/note_data_builder_spec.rb b/spec/lib/gitlab/note_data_builder_spec.rb
index 448cd0c6880dcd58c23174cc62de6deec7453c2a..6cbdae737f4ef679c50bb60527bda6ef12834af5 100644
--- a/spec/lib/gitlab/note_data_builder_spec.rb
+++ b/spec/lib/gitlab/note_data_builder_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe 'Gitlab::NoteDataBuilder' do
+describe 'Gitlab::NoteDataBuilder', lib: true do
   let(:project) { create(:project) }
   let(:user) { create(:user) }
   let(:data) { Gitlab::NoteDataBuilder.build(note, user) }
diff --git a/spec/lib/gitlab/o_auth/auth_hash_spec.rb b/spec/lib/gitlab/o_auth/auth_hash_spec.rb
index 5632f2306ec6f5ce037e5f46957db3b449161e89..a4f8b44e38e0dd89cabeb6b4a0b820d1e305b508 100644
--- a/spec/lib/gitlab/o_auth/auth_hash_spec.rb
+++ b/spec/lib/gitlab/o_auth/auth_hash_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::OAuth::AuthHash do
+describe Gitlab::OAuth::AuthHash, lib: true do
   let(:auth_hash) do
     Gitlab::OAuth::AuthHash.new(
       OmniAuth::AuthHash.new(
diff --git a/spec/lib/gitlab/o_auth/user_spec.rb b/spec/lib/gitlab/o_auth/user_spec.rb
index fd3ab1fb7c86808e53f9639460605cb19a2da47e..925bc442a903138459e5f1b56c154733835fe4cf 100644
--- a/spec/lib/gitlab/o_auth/user_spec.rb
+++ b/spec/lib/gitlab/o_auth/user_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::OAuth::User do
+describe Gitlab::OAuth::User, lib: true do
   let(:oauth_user) { Gitlab::OAuth::User.new(auth_hash) }
   let(:gl_user) { oauth_user.gl_user }
   let(:uid) { 'my-uid' }
diff --git a/spec/lib/gitlab/popen_spec.rb b/spec/lib/gitlab/popen_spec.rb
index e53efec6c67c4f5734652b55de4d443b17b6dccb..795cf241278aad1abd989a6b1d1b2ef39b0c5ff1 100644
--- a/spec/lib/gitlab/popen_spec.rb
+++ b/spec/lib/gitlab/popen_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe 'Gitlab::Popen', no_db: true do
+describe 'Gitlab::Popen', lib: true, no_db: true do
   let(:path) { Rails.root.join('tmp').to_s }
 
   before do
diff --git a/spec/lib/gitlab/project_search_results_spec.rb b/spec/lib/gitlab/project_search_results_spec.rb
index 19327ac8ce030f2622e2a3ba7dac59b9c41cc430..efc2e5f4ef1fda1ee96566c9d2c7a12daf2471d3 100644
--- a/spec/lib/gitlab/project_search_results_spec.rb
+++ b/spec/lib/gitlab/project_search_results_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::ProjectSearchResults do
+describe Gitlab::ProjectSearchResults, lib: true do
   let(:project) { create(:project) }
   let(:query) { 'hello world' }
 
diff --git a/spec/lib/gitlab/push_data_builder_spec.rb b/spec/lib/gitlab/push_data_builder_spec.rb
index 2170399ab5c180fd22b761929d156abc3743c6e2..3ef61685398601a3f09c160fa2ac607631bb8e59 100644
--- a/spec/lib/gitlab/push_data_builder_spec.rb
+++ b/spec/lib/gitlab/push_data_builder_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe 'Gitlab::PushDataBuilder' do
+describe 'Gitlab::PushDataBuilder', lib: true do
   let(:project) { create(:project) }
   let(:user) { create(:user) }
 
diff --git a/spec/lib/gitlab/reference_extractor_spec.rb b/spec/lib/gitlab/reference_extractor_spec.rb
index ad84d2274e804736329c47fd087f7e91144da7c9..66dc5d4911d8cd064e455e03ff3099c1646b71d5 100644
--- a/spec/lib/gitlab/reference_extractor_spec.rb
+++ b/spec/lib/gitlab/reference_extractor_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::ReferenceExtractor do
+describe Gitlab::ReferenceExtractor, lib: true do
   let(:project) { create(:project) }
   subject { Gitlab::ReferenceExtractor.new(project, project.creator) }
 
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb
index 7fdc8fa600d87e8ca9a8317df6ca483f5ca1d3df..d67ee423b9baf7ad0e350758a19c93b44c0119f8 100644
--- a/spec/lib/gitlab/regex_spec.rb
+++ b/spec/lib/gitlab/regex_spec.rb
@@ -1,7 +1,7 @@
 # coding: utf-8
 require 'spec_helper'
 
-describe Gitlab::Regex do
+describe Gitlab::Regex, lib: true do
   describe 'project path regex' do
     it { expect('gitlab-ce').to match(Gitlab::Regex.project_path_regex) }
     it { expect('gitlab_git').to match(Gitlab::Regex.project_path_regex) }
diff --git a/spec/lib/gitlab/sherlock/collection_spec.rb b/spec/lib/gitlab/sherlock/collection_spec.rb
index a8a9d6fc7bc171f771893a605f193b11d6019140..de6bb86c5ddd8a826487e25e8742d69ffd4e0bc8 100644
--- a/spec/lib/gitlab/sherlock/collection_spec.rb
+++ b/spec/lib/gitlab/sherlock/collection_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Sherlock::Collection do
+describe Gitlab::Sherlock::Collection, lib: true do
   let(:collection) { described_class.new }
 
   let(:transaction) do
diff --git a/spec/lib/gitlab/sherlock/file_sample_spec.rb b/spec/lib/gitlab/sherlock/file_sample_spec.rb
index f05a59f56f6cb56a76ef3a74a09075861194ea49..cadf8bbce78057558264b159703a2d95517227bc 100644
--- a/spec/lib/gitlab/sherlock/file_sample_spec.rb
+++ b/spec/lib/gitlab/sherlock/file_sample_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Sherlock::FileSample do
+describe Gitlab::Sherlock::FileSample, lib: true do
   let(:sample) { described_class.new(__FILE__, [], 150.4, 2) }
 
   describe '#id' do
diff --git a/spec/lib/gitlab/sherlock/line_profiler_spec.rb b/spec/lib/gitlab/sherlock/line_profiler_spec.rb
index 8f2e1299714ee17775b5b9f1d63d4508193a2660..d57627bba2b4ab885d793a8313067fae8e21b816 100644
--- a/spec/lib/gitlab/sherlock/line_profiler_spec.rb
+++ b/spec/lib/gitlab/sherlock/line_profiler_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Sherlock::LineProfiler do
+describe Gitlab::Sherlock::LineProfiler, lib: true do
   let(:profiler) { described_class.new }
 
   describe '#profile' do
diff --git a/spec/lib/gitlab/sherlock/line_sample_spec.rb b/spec/lib/gitlab/sherlock/line_sample_spec.rb
index 5f02f6a3213eb0b998f6b7c2edc6e5b78edbd2d2..f9b61f8684e9203c7dbb9d712cdbefce41697f7f 100644
--- a/spec/lib/gitlab/sherlock/line_sample_spec.rb
+++ b/spec/lib/gitlab/sherlock/line_sample_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Sherlock::LineSample do
+describe Gitlab::Sherlock::LineSample, lib: true do
   let(:sample) { described_class.new(150.0, 4) }
 
   describe '#duration' do
diff --git a/spec/lib/gitlab/sherlock/location_spec.rb b/spec/lib/gitlab/sherlock/location_spec.rb
index b295a624b35e47c86e67ac37da61ddfb233f27dc..5739afa6b1e7064a0e8f77b4b511f9069d4e60fe 100644
--- a/spec/lib/gitlab/sherlock/location_spec.rb
+++ b/spec/lib/gitlab/sherlock/location_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Sherlock::Location do
+describe Gitlab::Sherlock::Location, lib: true do
   let(:location) { described_class.new(__FILE__, 1) }
 
   describe 'from_ruby_location' do
diff --git a/spec/lib/gitlab/sherlock/middleware_spec.rb b/spec/lib/gitlab/sherlock/middleware_spec.rb
index aa74fc53a7954dd6a2413eab494ec4eef64a8d25..2bbeb25ce98341bbaa68d16b9615f9e89c557ac4 100644
--- a/spec/lib/gitlab/sherlock/middleware_spec.rb
+++ b/spec/lib/gitlab/sherlock/middleware_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Sherlock::Middleware do
+describe Gitlab::Sherlock::Middleware, lib: true do
   let(:app) { double(:app) }
   let(:middleware) { described_class.new(app) }
 
diff --git a/spec/lib/gitlab/sherlock/query_spec.rb b/spec/lib/gitlab/sherlock/query_spec.rb
index a9afef5dc1dc8a7ac579bb7eead3ac44d47b320e..05da915ccfd827cc693f2512cad2aa1980a0ca5a 100644
--- a/spec/lib/gitlab/sherlock/query_spec.rb
+++ b/spec/lib/gitlab/sherlock/query_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Sherlock::Query do
+describe Gitlab::Sherlock::Query, lib: true do
   let(:started_at)  { Time.utc(2015, 1, 1) }
   let(:finished_at) { started_at + 5 }
 
diff --git a/spec/lib/gitlab/sherlock/transaction_spec.rb b/spec/lib/gitlab/sherlock/transaction_spec.rb
index fb80c62c79479018114b643e0b40b80a1cd97a38..7553f2a045fc6cdd7a1a8b990b90c07b3e748e81 100644
--- a/spec/lib/gitlab/sherlock/transaction_spec.rb
+++ b/spec/lib/gitlab/sherlock/transaction_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Sherlock::Transaction do
+describe Gitlab::Sherlock::Transaction, lib: true do
   let(:transaction) { described_class.new('POST', '/cat_pictures') }
 
   describe '#id' do
diff --git a/spec/lib/gitlab/sql/union_spec.rb b/spec/lib/gitlab/sql/union_spec.rb
index 9e1cd4419e0b00bdc904f3279db285706a4ae07c..0cdbab8754417a4a5d4494718186372f7d42d801 100644
--- a/spec/lib/gitlab/sql/union_spec.rb
+++ b/spec/lib/gitlab/sql/union_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::SQL::Union do
+describe Gitlab::SQL::Union, lib: true do
   describe '#to_sql' do
     it 'returns a String joining relations together using a UNION' do
       rel1  = User.where(email: 'alice@example.com')
diff --git a/spec/lib/gitlab/themes_spec.rb b/spec/lib/gitlab/themes_spec.rb
index e554458e41ca55fc6c5e3349879812e3a1a1f0b5..7a140518dd2448f348fa46907157d7caab6da44c 100644
--- a/spec/lib/gitlab/themes_spec.rb
+++ b/spec/lib/gitlab/themes_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Themes do
+describe Gitlab::Themes, lib: true do
   describe '.body_classes' do
     it 'returns a space-separated list of class names' do
       css = described_class.body_classes
diff --git a/spec/lib/gitlab/upgrader_spec.rb b/spec/lib/gitlab/upgrader_spec.rb
index 8df84665e166a6cc18eda8f75bf8d0d83a7ae78e..e958e087a80ff0a8a087c7f64877c285c7498421 100644
--- a/spec/lib/gitlab/upgrader_spec.rb
+++ b/spec/lib/gitlab/upgrader_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::Upgrader do
+describe Gitlab::Upgrader, lib: true do
   let(:upgrader) { Gitlab::Upgrader.new }
   let(:current_version) { Gitlab::VERSION }
 
diff --git a/spec/lib/gitlab/uploads_transfer_spec.rb b/spec/lib/gitlab/uploads_transfer_spec.rb
index 260364a513e4d2646213999645cd09511ba0b85d..4092f7fb638e19f732234be4324ab847b374222e 100644
--- a/spec/lib/gitlab/uploads_transfer_spec.rb
+++ b/spec/lib/gitlab/uploads_transfer_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::UploadsTransfer do
+describe Gitlab::UploadsTransfer, lib: true do
   before do
     @root_dir = File.join(Rails.root, "public", "uploads")
     @upload_transfer = Gitlab::UploadsTransfer.new
diff --git a/spec/lib/gitlab/url_builder_spec.rb b/spec/lib/gitlab/url_builder_spec.rb
index 5153ed15af3f865fed83d30545d9d99a82685639..f023be6ae45dd3e7374a5a70d6e4703eafb17f1c 100644
--- a/spec/lib/gitlab/url_builder_spec.rb
+++ b/spec/lib/gitlab/url_builder_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe Gitlab::UrlBuilder do
+describe Gitlab::UrlBuilder, lib: true do
   describe 'When asking for an issue' do
     it 'returns the issue url' do
       issue = create(:issue)
diff --git a/spec/lib/gitlab/version_info_spec.rb b/spec/lib/gitlab/version_info_spec.rb
index 18f71b40fe093cdb7c5e766fc0e126809e31a425..706ee9bec5809128ded7b44cfaad9282489affa9 100644
--- a/spec/lib/gitlab/version_info_spec.rb
+++ b/spec/lib/gitlab/version_info_spec.rb
@@ -1,6 +1,6 @@
 require 'spec_helper'
 
-describe 'Gitlab::VersionInfo', no_db: true do
+describe 'Gitlab::VersionInfo', lib: true, no_db: true do
   before do
     @unknown = Gitlab::VersionInfo.new
     @v0_0_1 = Gitlab::VersionInfo.new(0, 0, 1)
diff --git a/spec/lib/repository_cache_spec.rb b/spec/lib/repository_cache_spec.rb
index 37240d5131087c81176b3781d962e6ecca4699cb..63b5292b098e91034e6ace12cdea9b7fdd1bf911 100644
--- a/spec/lib/repository_cache_spec.rb
+++ b/spec/lib/repository_cache_spec.rb
@@ -1,6 +1,6 @@
 require_relative '../../lib/repository_cache'
 
-describe RepositoryCache do
+describe RepositoryCache, lib: true do
   let(:backend) { double('backend').as_null_object }
   let(:cache) { RepositoryCache.new('example', backend) }