diff --git a/gitlab-ci-config/gitlab-com.yml b/gitlab-ci-config/gitlab-com.yml
index ae76c91e070e02a4c3754361d4ea7c05e89345e8_Z2l0bGFiLWNpLWNvbmZpZy9naXRsYWItY29tLnltbA==..7d98dc6951e0c39af4ebec63b9ebec4e9871961c_Z2l0bGFiLWNpLWNvbmZpZy9naXRsYWItY29tLnltbA== 100644
--- a/gitlab-ci-config/gitlab-com.yml
+++ b/gitlab-ci-config/gitlab-com.yml
@@ -128,7 +128,7 @@
   - bundle exec rake cache:bundle
   - bundle exec rake build:component_shas
 
-.spec_template:
+.spec_template: &spec_template
   extends: .gems-cache
   stage: tests
   before_script:
@@ -136,6 +136,18 @@
     # so tests run fine on forks
     - export ALTERNATIVE_SOURCES="true";
     - *install-gems
+  <<: *com-except-triggers-docs-and-deps
+  retry: 1
+  script:
+    - bundle exec rspec --color --format RspecJunitFormatter --out junit_rspec.xml --format documentation spec/lib
+  artifacts:
+    reports:
+      junit: junit_rspec.xml
+
+.chef_spec_template:
+  extends: .spec_template
+  variables:
+    KNAPSACK_TEST_FILE_PATTERN: "spec/chef/**{,/*/**}/*_spec.rb"
   script:
     - JOB_NAME=( $CI_JOB_NAME )
     - export DISTRO_NAME=${JOB_NAME[0]}
@@ -150,8 +162,7 @@
     - rm -f knapsack/*.json
     - mv ${KNAPSACK_REPORT_PATH}.bak ${KNAPSACK_REPORT_PATH}
     - bundle exec rake "knapsack:rspec[--color --format RspecJunitFormatter --out junit_rspec.xml --format documentation]"
-  <<: *com-except-triggers-docs-and-deps
   artifacts:
     <<: *knapsack-artifacts
     reports:
       junit: junit_rspec.xml
@@ -154,8 +165,7 @@
   artifacts:
     <<: *knapsack-artifacts
     reports:
       junit: junit_rspec.xml
-  retry: 1
 
 .trigger-job:
   stage: trigger-package
@@ -418,5 +428,11 @@
 Ubuntu 20.04 knapsack: *prepare_knapsack
 AmazonLinux 2 knapsack: *prepare_knapsack
 
+build library specs:
+  image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-focal"
+  extends: .spec_template
+  needs:
+    - rubocop
+
 Ubuntu 16.04 specs:
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-xenial"
@@ -421,8 +437,8 @@
 Ubuntu 16.04 specs:
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-xenial"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - Ubuntu 16.04 knapsack
 Ubuntu 18.04 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-bionic"
@@ -424,11 +440,11 @@
   parallel: 6
   needs:
   - Ubuntu 16.04 knapsack
 Ubuntu 18.04 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-bionic"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - Ubuntu 18.04 knapsack
 Ubuntu 20.04 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-focal"
@@ -430,11 +446,11 @@
   parallel: 6
   needs:
   - Ubuntu 18.04 knapsack
 Ubuntu 20.04 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-focal"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - Ubuntu 20.04 knapsack
 Debian 9 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-stretch"
@@ -436,11 +452,11 @@
   parallel: 6
   needs:
   - Ubuntu 20.04 knapsack
 Debian 9 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-stretch"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - Debian 9 knapsack
 Debian 10 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-buster"
@@ -442,11 +458,11 @@
   parallel: 6
   needs:
   - Debian 9 knapsack
 Debian 10 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-buster"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - Debian 10 knapsack
 Debian 11 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-bullseye"
@@ -448,11 +464,11 @@
   parallel: 6
   needs:
   - Debian 10 knapsack
 Debian 11 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-bullseye"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - Debian 11 knapsack
 Centos 7 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-centos7"
@@ -454,11 +470,11 @@
   parallel: 6
   needs:
   - Debian 11 knapsack
 Centos 7 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-centos7"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - Centos 7 knapsack
 Centos 8 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-centos8"
@@ -460,11 +476,11 @@
   parallel: 6
   needs:
   - Centos 7 knapsack
 Centos 8 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-centos8"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - Centos 8 knapsack
 OpenSUSE 15.3 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-opensuse15.3"
@@ -466,11 +482,11 @@
   parallel: 6
   needs:
   - Centos 8 knapsack
 OpenSUSE 15.3 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-opensuse15.3"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - OpenSUSE 15.3 knapsack
 AmazonLinux 2 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-amazonlinux2"
@@ -472,9 +488,9 @@
   parallel: 6
   needs:
   - OpenSUSE 15.3 knapsack
 AmazonLinux 2 specs :
   image: "registry.gitlab.com/gitlab-org/gitlab-build-images:omnibus-gitlab-amazonlinux2"
-  extends: .spec_template
+  extends: .chef_spec_template
   parallel: 6
   needs:
   - AmazonLinux 2 knapsack
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index ae76c91e070e02a4c3754361d4ea7c05e89345e8_c3BlYy9zcGVjX2hlbHBlci5yYg==..7d98dc6951e0c39af4ebec63b9ebec4e9871961c_c3BlYy9zcGVjX2hlbHBlci5yYg== 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -14,6 +14,9 @@
 $LOAD_PATH << './files/gitlab-ctl-commands/lib'
 
 Knapsack::Adapters::RSpecAdapter.bind if Gitlab::Util.get_env('USE_KNAPSACK')
+Knapsack.report.config({
+                         test_file_pattern: 'spec/chef/**/*_spec.rb'
+                       })
 
 RSpec.configure do |config|
   config.example_status_persistence_file_path = './spec/examples.txt' unless Gitlab::Util.get_env('CI')