summaryrefslogtreecommitdiff
path: root/spec/integration/php
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-03-04 11:03:04 -0700
committermo khan <mo.khan@gmail.com>2020-03-04 11:03:04 -0700
commit77bd1c9975fc2f12b457f4ca9990d788957af330 (patch)
treef5dcc150ed88206129ad93776bb326e502254464 /spec/integration/php
parent92003767408322277b043f4c64a305e1d893f958 (diff)
Extract shared example to convert QA jobs to integration tests
Diffstat (limited to 'spec/integration/php')
-rw-r--r--spec/integration/php/composer_spec.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/spec/integration/php/composer_spec.rb b/spec/integration/php/composer_spec.rb
index cc89a70..271730c 100644
--- a/spec/integration/php/composer_spec.rb
+++ b/spec/integration/php/composer_spec.rb
@@ -1,6 +1,8 @@
require 'spec_helper'
RSpec.describe "composer" do
+ include_examples "each report version", "php", "composer"
+
context "when the project's dependencies require php-gd e.g. in the case of Drupal" do
it 'installs the required dependencies and produces a valid report' do
# composer.json from https://git.drupalcode.org/project/drupal/raw/8.7.x/core/composer.json
@@ -116,20 +118,18 @@ RSpec.describe "composer" do
end
end
- [
- { version: '1.0', expected: 'expected/php/composer/v1.0.json' },
- { version: '1.1', expected: 'expected/php/composer/v1.1.json' },
- { version: '2.0', expected: 'expected/php/composer/v2.0.json' },
- ].each do |data|
- context "when generating a `#{data[:version]}` report" do
- let(:url) { 'https://gitlab.com/gitlab-org/security-products/tests/php-composer.git' }
+ #[ '1.0', '1.1', '2.0' ].each do |version|
+ #context "when generating a `#{version}` report" do
+ #let(:language) { 'php' }
+ #let(:package_manager) { 'composer' }
+ #let(:url) { "https://gitlab.com/gitlab-org/security-products/tests/#{language}-#{package_manager}.git" }
- it 'matches the expected report' do
- runner.clone(url)
- report = runner.scan(env: { 'LM_REPORT_VERSION' => data[:version] })
- #expect(report).to match_schema(version: data[:version])
- expect(report).to eql(fixture_file(data[:expected]))
- end
- end
- end
+ #it 'matches the expected report' do
+ #runner.clone(url)
+ #report = runner.scan(env: { 'LM_REPORT_VERSION' => version })
+ ##expect(report).to match_schema(version: version)
+ #expect(report).to eql(fixture_file("expected/#{language}/#{package_manager}/v#{version}.json"))
+ #end
+ #end
+ #end
end