Commit efa00b88 authored by Fabio Pitino's avatar Fabio Pitino

Fix specs for tracking CI minutes when runner is specific

Previous specs were running on public project which by
default gets a 0.0 Runner cost factor. Switching to use
private projects we test the actual logic of returning
0.0 Runner cost factor when runner is specific.
parent 568571cf
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Ci::Minutes::UpdateBuildMinutesService do RSpec.describe Ci::Minutes::UpdateBuildMinutesService do
describe '#perform' do describe '#perform' do
let(:namespace) { create(:namespace, shared_runners_minutes_limit: 100) } let(:namespace) { create(:namespace, shared_runners_minutes_limit: 100) }
let(:project) { create(:project, :public, namespace: namespace) } let(:project) { create(:project, :private, namespace: namespace) }
let(:pipeline) { create(:ci_pipeline, project: project) } let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) do let(:build) do
...@@ -33,7 +33,7 @@ RSpec.describe Ci::Minutes::UpdateBuildMinutesService do ...@@ -33,7 +33,7 @@ RSpec.describe Ci::Minutes::UpdateBuildMinutesService do
context 'with shared runner' do context 'with shared runner' do
let(:cost_factor) { 2.0 } let(:cost_factor) { 2.0 }
let(:runner) { create(:ci_runner, :instance, public_projects_minutes_cost_factor: cost_factor) } let(:runner) { create(:ci_runner, :instance, private_projects_minutes_cost_factor: cost_factor) }
it 'creates a statistics and sets duration with applied cost factor' do it 'creates a statistics and sets duration with applied cost factor' do
subject subject
......
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