summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2018-02-24 00:02:13 +0900
committerShinya Maeda <shinya@gitlab.com>2018-02-24 00:02:13 +0900
commit1670a9fe98dc636cdf455f4177d359934b83b073 (patch)
tree019b2e5a22b1cb45960343e11c139fd31c36837a
parent414a638bc2460274e5b977094c327b7be6747576 (diff)
downloadgitlab-ce-1670a9fe98dc636cdf455f4177d359934b83b073.tar.gz
Fixed static analysys
-rw-r--r--app/services/ci/create_trace_artifact_service.rb2
-rw-r--r--spec/services/ci/create_trace_artifact_service_spec.rb10
2 files changed, 6 insertions, 6 deletions
diff --git a/app/services/ci/create_trace_artifact_service.rb b/app/services/ci/create_trace_artifact_service.rb
index 00151f4bd1c..baa33de2857 100644
--- a/app/services/ci/create_trace_artifact_service.rb
+++ b/app/services/ci/create_trace_artifact_service.rb
@@ -4,7 +4,7 @@ module Ci
return if job.job_artifacts_trace
job.trace.read do |stream|
- return unless stream.file?
+ return unless stream.file? # rubocop:disable Lint/NonLocalExitFromIterator
temp_file!(stream.path, JobArtifactUploader.workhorse_upload_path) do |temp_path|
job.create_job_artifacts_trace!(
diff --git a/spec/services/ci/create_trace_artifact_service_spec.rb b/spec/services/ci/create_trace_artifact_service_spec.rb
index f928deb8632..dc22165c9e2 100644
--- a/spec/services/ci/create_trace_artifact_service_spec.rb
+++ b/spec/services/ci/create_trace_artifact_service_spec.rb
@@ -12,13 +12,13 @@ describe Ci::CreateTraceArtifactService do
let(:new_path) { job.job_artifacts_trace.file.path }
let(:new_checksum) { Digest::SHA256.file(new_path).hexdigest }
- it { expect(File.exists?(legacy_path)).to be_truthy }
+ it { expect(File.exist?(legacy_path)).to be_truthy }
it 'creates trace artifact' do
expect { subject }.to change { Ci::JobArtifact.count }.by(1)
- expect(File.exists?(legacy_path)).to be_falsy
- expect(File.exists?(new_path)).to be_truthy
+ expect(File.exist?(legacy_path)).to be_falsy
+ expect(File.exist?(new_path)).to be_truthy
expect(new_checksum).to eq(legacy_checksum)
expect(job.job_artifacts_trace.file.exists?).to be_truthy
expect(job.job_artifacts_trace.file.filename).to eq('job.log')
@@ -37,7 +37,7 @@ describe Ci::CreateTraceArtifactService do
end
it 'keeps legacy trace and removes trace artifact' do
- expect(File.exists?(legacy_path)).to be_truthy
+ expect(File.exist?(legacy_path)).to be_truthy
expect(job.job_artifacts_trace).to be_nil
end
end
@@ -50,7 +50,7 @@ describe Ci::CreateTraceArtifactService do
it 'raises an error' do
expect { subject }.to raise_error('Trace artifact not found')
- expect(File.exists?(legacy_path)).to be_truthy
+ expect(File.exist?(legacy_path)).to be_truthy
end
end
end