Commit b60d9fa0 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'improve_cluster_application_spec_time' into 'master'

Improve time to run cluster application specs

See merge request gitlab-org/gitlab!26767
parents 56040aef 8a4fba2e
...@@ -264,6 +264,8 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| ...@@ -264,6 +264,8 @@ RSpec.shared_examples 'cluster application status specs' do |application_name|
describe '#available?' do describe '#available?' do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
let_it_be(:cluster) { create(:cluster, :provided_by_gcp) }
where(:trait, :available) do where(:trait, :available) do
:not_installable | false :not_installable | false
:installable | false :installable | false
...@@ -280,7 +282,7 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| ...@@ -280,7 +282,7 @@ RSpec.shared_examples 'cluster application status specs' do |application_name|
end end
with_them do with_them do
subject { build(application_name, trait) } subject { build(application_name, trait, cluster: cluster) }
if params[:available] if params[:available]
it { is_expected.to be_available } it { is_expected.to be_available }
......
...@@ -2,16 +2,18 @@ ...@@ -2,16 +2,18 @@
RSpec.shared_examples 'cluster application version specs' do |application_name| RSpec.shared_examples 'cluster application version specs' do |application_name|
describe 'update_available?' do describe 'update_available?' do
let_it_be(:cluster) { create(:cluster, :provided_by_gcp) }
let(:version) { '0.0.0' } let(:version) { '0.0.0' }
subject { create(application_name, :installed, version: version).update_available? } subject { build(application_name, :installed, version: version, cluster: cluster).update_available? }
context 'version is not the same as VERSION' do context 'version is not the same as VERSION' do
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
end end
context 'version is the same as VERSION' do context 'version is the same as VERSION' do
let(:application) { build(application_name) } let(:application) { build(application_name, cluster: cluster) }
let(:version) { application.class.const_get(:VERSION, false) } let(:version) { application.class.const_get(:VERSION, false) }
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
......
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