diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-10-15 13:17:21 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-10-16 14:51:49 +0300 |
commit | 15cd91c71a57a0b84af620181a64b26d5aec8237 (patch) | |
tree | ecc0f8ed9b7d508b442c111faa199e52fa382924 /spec/presenters/ci | |
parent | 63cd88c668130d22f4a3d708894d0283a5941319 (diff) |
Make all legacy security reports to use raw format
- This introduces and uses `:raw` format for all legacy reports,
the ones that do not have yet proper parsers on Backend
- Raw format is needed to make Frontend be able to parse reports,
without the need of decompressing,
- This also extends fixtures to seed security reports with database,
even though parser code is part of EE
Diffstat (limited to 'spec/presenters/ci')
-rw-r--r-- | spec/presenters/ci/build_runner_presenter_spec.rb | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/spec/presenters/ci/build_runner_presenter_spec.rb b/spec/presenters/ci/build_runner_presenter_spec.rb index a42d1f3d399..170e0ac5717 100644 --- a/spec/presenters/ci/build_runner_presenter_spec.rb +++ b/spec/presenters/ci/build_runner_presenter_spec.rb @@ -40,21 +40,23 @@ describe Ci::BuildRunnerPresenter do context "with reports" do Ci::JobArtifact::DEFAULT_FILE_NAMES.each do |file_type, filename| - let(:report) { { "#{file_type}": [filename] } } - let(:build) { create(:ci_build, options: { artifacts: { reports: report } } ) } - - let(:report_expectation) do - { - name: filename, - artifact_type: :"#{file_type}", - artifact_format: :gzip, - paths: [filename], - when: 'always' - } - end - - it 'presents correct hash' do - expect(presenter.artifacts.first).to include(report_expectation) + context file_type.to_s do + let(:report) { { "#{file_type}": [filename] } } + let(:build) { create(:ci_build, options: { artifacts: { reports: report } } ) } + + let(:report_expectation) do + { + name: filename, + artifact_type: :"#{file_type}", + artifact_format: Ci::JobArtifact::TYPE_AND_FORMAT_PAIRS.fetch(file_type), + paths: [filename], + when: 'always' + } + end + + it 'presents correct hash' do + expect(presenter.artifacts.first).to include(report_expectation) + end end end end |