summaryrefslogtreecommitdiff
path: root/spec/requests/api/ci/runner/jobs_trace_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/ci/runner/jobs_trace_spec.rb')
-rw-r--r--spec/requests/api/ci/runner/jobs_trace_spec.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/spec/requests/api/ci/runner/jobs_trace_spec.rb b/spec/requests/api/ci/runner/jobs_trace_spec.rb
index e077a174b08..e20c7e36096 100644
--- a/spec/requests/api/ci/runner/jobs_trace_spec.rb
+++ b/spec/requests/api/ci/runner/jobs_trace_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
+RSpec.describe API::Ci::Runner, :clean_gitlab_redis_trace_chunks do
include StubGitlabCalls
include RedisHelpers
include WorkhorseHelpers
@@ -142,7 +142,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
context 'when redis data are flushed' do
before do
- redis_shared_state_cleanup!
+ redis_trace_chunks_cleanup!
end
it 'has empty trace' do
@@ -272,6 +272,18 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
it { expect(response).to have_gitlab_http_status(:forbidden) }
end
+ context 'when the job trace is too big' do
+ before do
+ project.actual_limits.update!(ci_jobs_trace_size_limit: 1)
+ end
+
+ it 'returns 403 Forbidden' do
+ patch_the_trace(' appended', headers.merge({ 'Content-Range' => "#{1.megabyte}-#{1.megabyte + 9}" }))
+
+ expect(response).to have_gitlab_http_status(:forbidden)
+ end
+ end
+
def patch_the_trace(content = ' appended', request_headers = nil, job_id: job.id)
unless request_headers
job.trace.read do |stream|