diff --git a/spec/models/concerns/ci/artifactable_spec.rb b/spec/models/concerns/ci/artifactable_spec.rb index b27a4d0dcc1f4036db441899f7cf96c983c1ff21..6af244a5a0f8d292d5ac4cf4e7adedd6b1fa995b 100644 --- a/spec/models/concerns/ci/artifactable_spec.rb +++ b/spec/models/concerns/ci/artifactable_spec.rb @@ -53,6 +53,15 @@ expect { |b| artifact.each_blob(&b) }.to raise_error(described_class::NotSupportedAdapterError) end end + + context 'pushes artifact_size to application context' do + let(:artifact) { create(:ci_job_artifact, :junit) } + + it 'logs artifact size', :aggregate_failures do + expect { |b| artifact.each_blob(&b) }.to yield_control.once + expect(Gitlab::ApplicationContext.current).to include("meta.artifact_size" => artifact.size) + end + end end context 'ActiveRecord scopes' do