diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-06 17:18:32 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 22:59:25 +0300 |
commit | 999118f0ec6edabc9e13c089381ad664970a080a (patch) | |
tree | 4201e2944efb5379c9355999fc3750d0b0710566 /spec/factories/ci | |
parent | b14c484bb1d174c7c355de2258be1a4414b2cf78 (diff) |
Merge branch 'feature/sm/artifacts-trace-ee' into 'master'
EE: Trace as artifacts (FileStorage and ObjectStorage)
Closes #4171
See merge request gitlab-org/gitlab-ee!4258
Diffstat (limited to 'spec/factories/ci')
-rw-r--r-- | spec/factories/ci/builds.rb | 10 | ||||
-rw-r--r-- | spec/factories/ci/job_artifacts.rb | 9 |
2 files changed, 17 insertions, 2 deletions
diff --git a/spec/factories/ci/builds.rb b/spec/factories/ci/builds.rb index 6f66468570f..6ba599cdf83 100644 --- a/spec/factories/ci/builds.rb +++ b/spec/factories/ci/builds.rb @@ -135,13 +135,19 @@ FactoryBot.define do coverage_regex '/(d+)/' end - trait :trace do + trait :trace_live do after(:create) do |build, evaluator| build.trace.set('BUILD TRACE') end end - trait :unicode_trace do + trait :trace_artifact do + after(:create) do |build, evaluator| + create(:ci_job_artifact, :trace, job: build) + end + end + + trait :unicode_trace_live do after(:create) do |build, evaluator| trace = File.binread( File.expand_path( diff --git a/spec/factories/ci/job_artifacts.rb b/spec/factories/ci/job_artifacts.rb index 9bb456e89ff..7ada3b904d3 100644 --- a/spec/factories/ci/job_artifacts.rb +++ b/spec/factories/ci/job_artifacts.rb @@ -30,5 +30,14 @@ FactoryBot.define do Rails.root.join('spec/fixtures/ci_build_artifacts_metadata.gz'), 'application/x-gzip') end end + + trait :trace do + file_type :trace + + after(:build) do |artifact, evaluator| + artifact.file = fixture_file_upload( + Rails.root.join('spec/fixtures/trace/sample_trace'), 'text/plain') + end + end end end |