Skip to content
Snippets Groups Projects
Commit 7d98dc6951e0 authored by Balasankar "Balu" C's avatar Balasankar "Balu" C
Browse files

Run build library rspecs in their own CI job

Run the build library rspec tests once total instead of once for each
platform supported by Omnibus GitLab.

Related https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/4809



Signed-off-by: default avatarBalasankar "Balu" C <balasankar@gitlab.com>
parent ae76c91e070e
No related branches found
No related tags found
1 merge request!72Intermediate build for testing purposes
......@@ -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
......
......@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment