Commit 21459f1a authored by Stan Hu's avatar Stan Hu

Merge branch 'sh-upgrade-ruby-2.7.2-ci' into 'master'

Upgrade to Ruby v2.7.2

See merge request gitlab-org/gitlab!44223
parents 213b2354 e2f8775e
...@@ -17,7 +17,7 @@ stages: ...@@ -17,7 +17,7 @@ stages:
# in cases where jobs require Docker-in-Docker, the job # in cases where jobs require Docker-in-Docker, the job
# definition must be extended with `.use-docker-in-docker` # definition must be extended with `.use-docker-in-docker`
default: default:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34"
tags: tags:
- gitlab-org - gitlab-org
# All jobs are interruptible by default # All jobs are interruptible by default
......
cloud-native-image: cloud-native-image:
extends: .cng:rules extends: .cng:rules
image: ruby:2.6-alpine image: ruby:2.7-alpine
dependencies: [] dependencies: []
stage: post-test stage: post-test
variables: variables:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
extends: extends:
- .default-retry - .default-retry
- .docs:rules:review-docs - .docs:rules:review-docs
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: review stage: review
needs: [] needs: []
variables: variables:
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
extends: extends:
- .frontend-base - .frontend-base
- .assets-compile-cache - .assets-compile-cache
image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-git-2.28-lfs-2.9-node-12.18-yarn-1.22-graphicsmagick-1.3.34 image: registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-git-2.28-lfs-2.9-node-12.18-yarn-1.22-graphicsmagick-1.3.34
variables: variables:
WEBPACK_VENDOR_DLL: "true" WEBPACK_VENDOR_DLL: "true"
stage: prepare stage: prepare
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
.rails-cache: .rails-cache:
cache: cache:
key: "rails-v2" key: "rails-v3"
paths: paths:
- vendor/ruby/ - vendor/ruby/
- vendor/gitaly-ruby/ - vendor/gitaly-ruby/
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
.static-analysis-cache: .static-analysis-cache:
cache: cache:
key: "static-analysis-v1" key: "static-analysis-v2"
paths: paths:
- vendor/ruby/ - vendor/ruby/
- node_modules/ - node_modules/
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
.qa-cache: .qa-cache:
cache: cache:
key: "qa-v1" key: "qa-v2"
paths: paths:
- qa/vendor/ruby/ - qa/vendor/ruby/
policy: pull policy: pull
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
policy: pull policy: pull
.use-pg11: .use-pg11:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34"
services: services:
- name: postgres:11.6 - name: postgres:11.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
.use-pg12: .use-pg12:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34"
services: services:
- name: postgres:12 - name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
.use-pg11-ee: .use-pg11-ee:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-11-graphicsmagick-1.3.34"
services: services:
- name: postgres:11.6 - name: postgres:11.6
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
.use-pg12-ee: .use-pg12-ee:
image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.6.6-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34" image: "registry.gitlab.com/gitlab-org/gitlab-build-images:ruby-2.7.2-golang-1.14-git-2.28-lfs-2.9-chrome-85-node-12.18-yarn-1.22-postgresql-12-graphicsmagick-1.3.34"
services: services:
- name: postgres:12 - name: postgres:12
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
before_script: before_script:
- '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb' - '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb'
- cd qa/ - cd qa/
- bundle install --clean --jobs=$(nproc) --path=vendor --retry=3 --quiet - gem install bundler -v 1.17.3
- bundle install --clean --jobs=$(nproc) --path=vendor --retry=3 --without=development --quiet
- bundle check - bundle check
qa:internal: qa:internal:
...@@ -47,7 +48,7 @@ update-qa-cache: ...@@ -47,7 +48,7 @@ update-qa-cache:
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up. policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
.package-and-qa-base: .package-and-qa-base:
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: qa stage: qa
retry: 0 retry: 0
script: script:
......
...@@ -181,6 +181,7 @@ update-coverage-cache: ...@@ -181,6 +181,7 @@ update-coverage-cache:
- .shared:rules:update-cache - .shared:rules:update-cache
stage: prepare stage: prepare
script: script:
- run_timed_command "gem install bundler -v 1.17.3"
- run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519" - run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519"
cache: cache:
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up. policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
...@@ -358,6 +359,7 @@ rspec:coverage: ...@@ -358,6 +359,7 @@ rspec:coverage:
- memory-static - memory-static
- memory-on-boot - memory-on-boot
script: script:
- run_timed_command "gem install bundler -v 1.17.3"
- run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519" - run_timed_command "bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet --without default development test production puma unicorn kerberos metrics omnibus ed25519"
- run_timed_command "bundle exec scripts/merge-simplecov" - run_timed_command "bundle exec scripts/merge-simplecov"
- run_timed_command "bundle exec scripts/gather-test-memory-data" - run_timed_command "bundle exec scripts/gather-test-memory-data"
......
...@@ -25,7 +25,7 @@ review-build-cng: ...@@ -25,7 +25,7 @@ review-build-cng:
extends: extends:
- .default-retry - .default-retry
- .review:rules:review-build-cng - .review:rules:review-build-cng
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: review-prepare stage: review-prepare
before_script: before_script:
- source ./scripts/utils.sh - source ./scripts/utils.sh
...@@ -122,7 +122,7 @@ review-stop: ...@@ -122,7 +122,7 @@ review-stop:
extends: extends:
- .default-retry - .default-retry
- .use-docker-in-docker - .use-docker-in-docker
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.6 image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7
stage: qa stage: qa
# This is needed so that manual jobs with needs don't block the pipeline. # This is needed so that manual jobs with needs don't block the pipeline.
# See https://gitlab.com/gitlab-org/gitlab/-/issues/199979. # See https://gitlab.com/gitlab-org/gitlab/-/issues/199979.
...@@ -199,7 +199,7 @@ review-performance: ...@@ -199,7 +199,7 @@ review-performance:
parallel-spec-reports: parallel-spec-reports:
extends: extends:
- .review:rules:mr-only-manual - .review:rules:mr-only-manual
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: post-qa stage: post-qa
dependencies: ["review-qa-all"] dependencies: ["review-qa-all"]
variables: variables:
......
...@@ -52,7 +52,7 @@ no_ee_check: ...@@ -52,7 +52,7 @@ no_ee_check:
verify-tests-yml: verify-tests-yml:
extends: extends:
- .setup:rules:verify-tests-yml - .setup:rules:verify-tests-yml
image: ruby:2.6-alpine image: ruby:2.7-alpine
stage: test stage: test
needs: [] needs: []
script: script:
...@@ -61,7 +61,7 @@ verify-tests-yml: ...@@ -61,7 +61,7 @@ verify-tests-yml:
- scripts/verify-tff-mapping - scripts/verify-tff-mapping
.detect-test-base: .detect-test-base:
image: ruby:2.6-alpine image: ruby:2.7-alpine
needs: [] needs: []
stage: prepare stage: prepare
script: script:
......
...@@ -79,7 +79,7 @@ Instructions on how to start GitLab and how to run the tests can be found in the ...@@ -79,7 +79,7 @@ Instructions on how to start GitLab and how to run the tests can be found in the
GitLab is a Ruby on Rails application that runs on the following software: GitLab is a Ruby on Rails application that runs on the following software:
- Ubuntu/Debian/CentOS/RHEL/OpenSUSE - Ubuntu/Debian/CentOS/RHEL/OpenSUSE
- Ruby (MRI) 2.6.6 - Ruby (MRI) 2.7.2
- Git 2.24+ - Git 2.24+
- Redis 4.0+ - Redis 4.0+
- PostgreSQL 11+ - PostgreSQL 11+
......
---
title: Update to Ruby v2.7.2
merge_request: 44223
author:
type: other
...@@ -243,9 +243,9 @@ Download Ruby and compile it: ...@@ -243,9 +243,9 @@ Download Ruby and compile it:
```shell ```shell
mkdir /tmp/ruby && cd /tmp/ruby mkdir /tmp/ruby && cd /tmp/ruby
curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.tar.gz curl --remote-name --progress https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.gz
echo '2d78048e293817f38d4ede4ebc7873013e97bb0b ruby-2.6.6.tar.gz' | shasum -c - && tar xzf ruby-2.6.6.tar.gz echo 'cb9731a17487e0ad84037490a6baf8bfa31a09e8 ruby-2.7.2.tar.gz' | shasum -c - && tar xzf ruby-2.7.2.tar.gz
cd ruby-2.6.6 cd ruby-2.7.2
./configure --disable-install-rdoc ./configure --disable-install-rdoc
make make
......
...@@ -775,11 +775,11 @@ or using the appropriate [`ASDF_<tool>_VERSION`](https://asdf-vm.com/#/core-conf ...@@ -775,11 +775,11 @@ or using the appropriate [`ASDF_<tool>_VERSION`](https://asdf-vm.com/#/core-conf
activate the appropriate version. activate the appropriate version.
For example, the following `.tool-versions` file will activate version `12.16.3` of [Node.js](https://nodejs.org/) For example, the following `.tool-versions` file will activate version `12.16.3` of [Node.js](https://nodejs.org/)
and version `2.6.6` of [Ruby](https://www.ruby-lang.org/). and version `2.7.2` of [Ruby](https://www.ruby-lang.org/).
```plaintext ```plaintext
nodejs 12.16.3 nodejs 12.16.3
ruby 2.6.6 ruby 2.7.2
``` ```
The next example shows how to activate the same versions of the tools mentioned above by using environment variables defined in your The next example shows how to activate the same versions of the tools mentioned above by using environment variables defined in your
...@@ -792,7 +792,7 @@ include: ...@@ -792,7 +792,7 @@ include:
license_scanning: license_scanning:
variables: variables:
ASDF_NODEJS_VERSION: '12.16.3' ASDF_NODEJS_VERSION: '12.16.3'
ASDF_RUBY_VERSION: '2.6.6' ASDF_RUBY_VERSION: '2.7.2'
``` ```
A full list of variables can be found in [environment variables](#available-variables). A full list of variables can be found in [environment variables](#available-variables).
......
...@@ -229,7 +229,7 @@ RSpec.describe MergeRequests::UpdateService, :mailer do ...@@ -229,7 +229,7 @@ RSpec.describe MergeRequests::UpdateService, :mailer do
context 'when reassigned' do context 'when reassigned' do
it 'schedules for analytics metric update' do it 'schedules for analytics metric update' do
expect(Analytics::CodeReviewMetricsWorker) expect(Analytics::CodeReviewMetricsWorker)
.to receive(:perform_async).with('Analytics::RefreshReassignData', merge_request.id, {}) .to receive(:perform_async).with('Analytics::RefreshReassignData', merge_request.id)
update_merge_request({ assignee_ids: [user2.id] }) update_merge_request({ assignee_ids: [user2.id] })
end end
......
FROM ruby:2.6-stretch FROM ruby:2.7-buster
LABEL maintainer="GitLab Quality Department <quality@gitlab.com>" LABEL maintainer="GitLab Quality Department <quality@gitlab.com>"
ENV DEBIAN_FRONTEND="noninteractive" ENV DEBIAN_FRONTEND="noninteractive"
...@@ -65,7 +65,7 @@ COPY VERSION ./ee/app/models/license.r[b] /home/gitlab/ee/app/models/ ...@@ -65,7 +65,7 @@ COPY VERSION ./ee/app/models/license.r[b] /home/gitlab/ee/app/models/
COPY ./lib/gitlab.rb /home/gitlab/lib/ COPY ./lib/gitlab.rb /home/gitlab/lib/
COPY ./lib/gitlab/utils.rb /home/gitlab/lib/gitlab/ COPY ./lib/gitlab/utils.rb /home/gitlab/lib/gitlab/
COPY ./INSTALLATION_TYPE ./VERSION /home/gitlab/ COPY ./INSTALLATION_TYPE ./VERSION /home/gitlab/
RUN cd /home/gitlab/qa/ && bundle install --jobs=$(nproc) --retry=3 --quiet RUN cd /home/gitlab/qa/ && gem install bundler:1.17.3 && bundle install --jobs=$(nproc) --retry=3 --without=development --quiet
COPY ./qa /home/gitlab/qa COPY ./qa /home/gitlab/qa
ENTRYPOINT ["bin/test"] ENTRYPOINT ["bin/test"]
...@@ -29,7 +29,7 @@ module QA ...@@ -29,7 +29,7 @@ module QA
end end
def executor_image def executor_image
@executor_image || 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.6' @executor_image || 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7'
end end
def fabricate_via_api! def fabricate_via_api!
......
...@@ -21,7 +21,7 @@ module QA ...@@ -21,7 +21,7 @@ module QA
@name = name || "qa-runner-#{SecureRandom.hex(4)}" @name = name || "qa-runner-#{SecureRandom.hex(4)}"
@run_untagged = true @run_untagged = true
@executor = :shell @executor = :shell
@executor_image = 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.6' @executor_image = 'registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7'
super() super()
end end
......
...@@ -5,6 +5,8 @@ export USE_BUNDLE_INSTALL=${USE_BUNDLE_INSTALL:-true} ...@@ -5,6 +5,8 @@ export USE_BUNDLE_INSTALL=${USE_BUNDLE_INSTALL:-true}
export BUNDLE_INSTALL_FLAGS=${BUNDLE_INSTALL_FLAGS:-"--without=production development --jobs=$(nproc) --path=vendor --retry=3 --quiet"} export BUNDLE_INSTALL_FLAGS=${BUNDLE_INSTALL_FLAGS:-"--without=production development --jobs=$(nproc) --path=vendor --retry=3 --quiet"}
if [ "$USE_BUNDLE_INSTALL" != "false" ]; then if [ "$USE_BUNDLE_INSTALL" != "false" ]; then
# This is for backwards compatibility for Gitaly
run_timed_command "gem install bundler:1.17.3"
bundle --version bundle --version
run_timed_command "bundle install --clean ${BUNDLE_INSTALL_FLAGS}" run_timed_command "bundle install --clean ${BUNDLE_INSTALL_FLAGS}"
run_timed_command "bundle check" run_timed_command "bundle check"
......
...@@ -59,7 +59,7 @@ RSpec.describe Projects::Registry::RepositoriesController do ...@@ -59,7 +59,7 @@ RSpec.describe Projects::Registry::RepositoriesController do
end end
it 'tracks the event' do it 'tracks the event' do
expect(Gitlab::Tracking).to receive(:event).with(anything, 'list_repositories', {}) expect(Gitlab::Tracking).to receive(:event).with(anything, 'list_repositories')
go_to_index(format: :json) go_to_index(format: :json)
end end
...@@ -133,7 +133,7 @@ RSpec.describe Projects::Registry::RepositoriesController do ...@@ -133,7 +133,7 @@ RSpec.describe Projects::Registry::RepositoriesController do
end end
it 'tracks the event' do it 'tracks the event' do
expect(Gitlab::Tracking).to receive(:event).with(anything, 'delete_repository', {}) expect(Gitlab::Tracking).to receive(:event).with(anything, 'delete_repository')
allow(DeleteContainerRepositoryWorker).to receive(:perform_async).with(user.id, repository.id) allow(DeleteContainerRepositoryWorker).to receive(:perform_async).with(user.id, repository.id)
delete_repository(repository) delete_repository(repository)
......
...@@ -40,7 +40,7 @@ RSpec.describe Projects::Registry::TagsController do ...@@ -40,7 +40,7 @@ RSpec.describe Projects::Registry::TagsController do
end end
it 'tracks the event' do it 'tracks the event' do
expect(Gitlab::Tracking).to receive(:event).with(anything, 'list_tags', {}) expect(Gitlab::Tracking).to receive(:event).with(anything, 'list_tags')
get_tags get_tags
end end
...@@ -109,7 +109,7 @@ RSpec.describe Projects::Registry::TagsController do ...@@ -109,7 +109,7 @@ RSpec.describe Projects::Registry::TagsController do
it 'tracks the event' do it 'tracks the event' do
expect_delete_tags(%w[test.]) expect_delete_tags(%w[test.])
expect(controller).to receive(:track_event).with(:delete_tag, {}) expect(controller).to receive(:track_event).with(:delete_tag)
destroy_tag('test.') destroy_tag('test.')
end end
...@@ -150,7 +150,7 @@ RSpec.describe Projects::Registry::TagsController do ...@@ -150,7 +150,7 @@ RSpec.describe Projects::Registry::TagsController do
it 'tracks the event' do it 'tracks the event' do
expect_delete_tags(tags) expect_delete_tags(tags)
expect(Gitlab::Tracking).to receive(:event).with(anything, 'delete_tag_bulk', {}) expect(Gitlab::Tracking).to receive(:event).with(anything, 'delete_tag_bulk')
bulk_destroy_tags(tags) bulk_destroy_tags(tags)
end end
......
...@@ -12,6 +12,9 @@ RSpec.describe 'Profile account page', :js do ...@@ -12,6 +12,9 @@ RSpec.describe 'Profile account page', :js do
describe 'when I delete my account' do describe 'when I delete my account' do
before do before do
visit profile_account_path visit profile_account_path
# Scroll page to the bottom to make Delete account button visible
execute_script('window.scrollTo(0, document.body.scrollHeight)')
end end
it { expect(page).to have_content('Delete account') } it { expect(page).to have_content('Delete account') }
......
...@@ -36,7 +36,7 @@ RSpec.describe Resolvers::ReleaseResolver do ...@@ -36,7 +36,7 @@ RSpec.describe Resolvers::ReleaseResolver do
let(:args) { {} } let(:args) { {} }
it 'raises an error' do it 'raises an error' do
expect { resolve_release }.to raise_error(ArgumentError, "missing keyword: tag_name") expect { resolve_release }.to raise_error(ArgumentError, "missing keyword: :tag_name")
end end
end end
end end
......
...@@ -177,7 +177,7 @@ RSpec.describe API::Helpers do ...@@ -177,7 +177,7 @@ RSpec.describe API::Helpers do
describe '#track_event' do describe '#track_event' do
it "creates a gitlab tracking event" do it "creates a gitlab tracking event" do
expect(Gitlab::Tracking).to receive(:event).with('foo', 'my_event', {}) expect(Gitlab::Tracking).to receive(:event).with('foo', 'my_event')
subject.track_event('my_event', category: 'foo') subject.track_event('my_event', category: 'foo')
end end
......
...@@ -15,14 +15,14 @@ RSpec.describe Gitlab::Ci::Variables::Collection::Item do ...@@ -15,14 +15,14 @@ RSpec.describe Gitlab::Ci::Variables::Collection::Item do
context 'when unknown keyword is specified' do context 'when unknown keyword is specified' do
it 'raises error' do it 'raises error' do
expect { described_class.new(key: variable_key, value: 'abc', files: true) } expect { described_class.new(key: variable_key, value: 'abc', files: true) }
.to raise_error ArgumentError, 'unknown keyword: files' .to raise_error ArgumentError, 'unknown keyword: :files'
end end
end end
context 'when required keywords are not specified' do context 'when required keywords are not specified' do
it 'raises error' do it 'raises error' do
expect { described_class.new(key: variable_key) } expect { described_class.new(key: variable_key) }
.to raise_error ArgumentError, 'missing keyword: value' .to raise_error ArgumentError, 'missing keyword: :value'
end end
end end
......
...@@ -38,7 +38,7 @@ RSpec.describe Gitlab::Config::Entry::Simplifiable do ...@@ -38,7 +38,7 @@ RSpec.describe Gitlab::Config::Entry::Simplifiable do
end end
it 'attemps to load a first strategy' do it 'attemps to load a first strategy' do
expect(first).to receive(:new).with('something', anything) expect(first).to receive(:new).with('something')
entry.new('something') entry.new('something')
end end
...@@ -53,7 +53,7 @@ RSpec.describe Gitlab::Config::Entry::Simplifiable do ...@@ -53,7 +53,7 @@ RSpec.describe Gitlab::Config::Entry::Simplifiable do
end end
it 'attemps to load a second strategy' do it 'attemps to load a second strategy' do
expect(second).to receive(:new).with('test', anything) expect(second).to receive(:new).with('test')
entry.new('test') entry.new('test')
end end
...@@ -68,7 +68,7 @@ RSpec.describe Gitlab::Config::Entry::Simplifiable do ...@@ -68,7 +68,7 @@ RSpec.describe Gitlab::Config::Entry::Simplifiable do
end end
it 'instantiates an unknown strategy' do it 'instantiates an unknown strategy' do
expect(unknown).to receive(:new).with('test', anything) expect(unknown).to receive(:new).with('test')
entry.new('test') entry.new('test')
end end
......
...@@ -62,7 +62,7 @@ RSpec.describe Gitlab::Tracking::IncidentManagement do ...@@ -62,7 +62,7 @@ RSpec.describe Gitlab::Tracking::IncidentManagement do
context 'param without label' do context 'param without label' do
let(:params) { { create_issue: '1' } } let(:params) { { create_issue: '1' } }
it_behaves_like 'a tracked event', "enabled_issue_auto_creation_on_alerts", {} it_behaves_like 'a tracked event', "enabled_issue_auto_creation_on_alerts"
end end
end end
......
...@@ -32,7 +32,7 @@ RSpec.describe OptionallySearch do ...@@ -32,7 +32,7 @@ RSpec.describe OptionallySearch do
it 'delegates to the search method' do it 'delegates to the search method' do
expect(model) expect(model)
.to receive(:search) .to receive(:search)
.with('foo', {}) .with('foo')
.and_call_original .and_call_original
expect(model.optionally_search('foo')).to eq(['foo', {}]) expect(model.optionally_search('foo')).to eq(['foo', {}])
......
...@@ -310,7 +310,7 @@ RSpec.describe API::ProjectContainerRepositories do ...@@ -310,7 +310,7 @@ RSpec.describe API::ProjectContainerRepositories do
it 'properly removes tag' do it 'properly removes tag' do
expect(service).to receive(:execute).with(root_repository) { { status: :success } } expect(service).to receive(:execute).with(root_repository) { { status: :success } }
expect(Projects::ContainerRepository::DeleteTagsService).to receive(:new).with(root_repository.project, api_user, tags: %w[rootA]) { service } expect(Projects::ContainerRepository::DeleteTagsService).to receive(:new).with(root_repository.project, api_user, tags: %w[rootA]) { service }
expect(Gitlab::Tracking).to receive(:event).with(described_class.name, 'delete_tag', {}) expect(Gitlab::Tracking).to receive(:event).with(described_class.name, 'delete_tag')
subject subject
...@@ -326,7 +326,7 @@ RSpec.describe API::ProjectContainerRepositories do ...@@ -326,7 +326,7 @@ RSpec.describe API::ProjectContainerRepositories do
it 'properly removes tag' do it 'properly removes tag' do
expect(service).to receive(:execute).with(root_repository) { { status: :success } } expect(service).to receive(:execute).with(root_repository) { { status: :success } }
expect(Projects::ContainerRepository::DeleteTagsService).to receive(:new).with(root_repository.project, api_user, tags: %w[rootA]) { service } expect(Projects::ContainerRepository::DeleteTagsService).to receive(:new).with(root_repository.project, api_user, tags: %w[rootA]) { service }
expect(Gitlab::Tracking).to receive(:event).with(described_class.name, 'delete_tag', {}) expect(Gitlab::Tracking).to receive(:event).with(described_class.name, 'delete_tag')
subject subject
......
...@@ -15,7 +15,7 @@ RSpec.shared_examples 'a Trackable Controller' do ...@@ -15,7 +15,7 @@ RSpec.shared_examples 'a Trackable Controller' do
end end
it 'tracks the action name' do it 'tracks the action name' do
expect(Gitlab::Tracking).to receive(:event).with('AnonymousController', 'index', {}) expect(Gitlab::Tracking).to receive(:event).with('AnonymousController', 'index')
get :index get :index
end end
end end
......
...@@ -129,7 +129,7 @@ end ...@@ -129,7 +129,7 @@ end
RSpec.shared_examples 'a package tracking event' do |category, action| RSpec.shared_examples 'a package tracking event' do |category, action|
it "creates a gitlab tracking event #{action}" do it "creates a gitlab tracking event #{action}" do
expect(Gitlab::Tracking).to receive(:event).with(category, action, {}) expect(Gitlab::Tracking).to receive(:event).with(category, action)
expect { subject }.to change { Packages::Event.count }.by(1) expect { subject }.to change { Packages::Event.count }.by(1)
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
RSpec.shared_examples 'a gitlab tracking event' do |category, action| RSpec.shared_examples 'a gitlab tracking event' do |category, action|
it "creates a gitlab tracking event #{action}" do it "creates a gitlab tracking event #{action}" do
expect(Gitlab::Tracking).to receive(:event).with(category, action, {}) expect(Gitlab::Tracking).to receive(:event).with(category, action)
subject subject
end end
......
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