summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-03-04 11:58:55 -0700
committermo khan <mo.khan@gmail.com>2020-03-04 11:58:55 -0700
commit5957399681c8de847dbc062ca8d8e559fb38eb55 (patch)
tree75c14977cb75bee3eaa57d907aa9fc0fc04b76de
parentf21567cf14e242715e0be1337cf762f68866c1dd (diff)
Convert pipenv qa jobs to integration tests
-rw-r--r--.gitlab/qa.yml19
-rwxr-xr-xrun.sh1
-rw-r--r--spec/integration/python/pipenv_spec.rb2
-rw-r--r--spec/support/integration_test_helper.rb4
-rw-r--r--spec/support/shared.rb4
5 files changed, 7 insertions, 23 deletions
diff --git a/.gitlab/qa.yml b/.gitlab/qa.yml
index 7f9f9ef..59c639c 100644
--- a/.gitlab/qa.yml
+++ b/.gitlab/qa.yml
@@ -52,22 +52,3 @@ QA:python3-pip-v2:
variables:
LM_REPORT_VERSION: 2
QA_RESULTS: python3-pip-v2
-
-QA:python3-pipenv:
- extends: .QA
- variables:
- QA_RESULTS: python-pipenv-v1
- QA_PROJECT: python-pipenv
- QA_REF: pip-file-lock
-
-QA:python3-pipenv-v1-1:
- extends: QA:python3-pipenv
- variables:
- LM_REPORT_VERSION: '1.1'
- QA_RESULTS: python-pipenv-v1.1
-
-QA:python3-pipenv-v2:
- extends: QA:python3-pipenv
- variables:
- LM_REPORT_VERSION: 2
- QA_RESULTS: python-pipenv-v2
diff --git a/run.sh b/run.sh
index 109f48c..4e85ae7 100755
--- a/run.sh
+++ b/run.sh
@@ -90,4 +90,5 @@ function test_project() {
echo "OK"
}
+echo "$@"
scan_project "$1"
diff --git a/spec/integration/python/pipenv_spec.rb b/spec/integration/python/pipenv_spec.rb
index 1ea60fe..c8ee01d 100644
--- a/spec/integration/python/pipenv_spec.rb
+++ b/spec/integration/python/pipenv_spec.rb
@@ -1,6 +1,8 @@
require 'spec_helper'
RSpec.describe "pipenv" do
+ include_examples "each report version", "python", "pipenv", "pip-file-lock"
+
context "when a project depends on a version 6 Pipfile.lock" do
let(:pipfile_lock_content) do
JSON.pretty_generate({
diff --git a/spec/support/integration_test_helper.rb b/spec/support/integration_test_helper.rb
index 09843c3..23f7970 100644
--- a/spec/support/integration_test_helper.rb
+++ b/spec/support/integration_test_helper.rb
@@ -13,8 +13,8 @@ module IntegrationTestHelper
IO.write(full_path, block_given? ? yield : content)
end
- def clone(repo)
- execute({}, "git clone #{repo} #{project_path}")
+ def clone(repo, branch: 'master')
+ execute({}, "git clone -b #{branch} #{repo} #{project_path}")
end
def scan(env: {})
diff --git a/spec/support/shared.rb b/spec/support/shared.rb
index a25d8ab..92d4531 100644
--- a/spec/support/shared.rb
+++ b/spec/support/shared.rb
@@ -1,10 +1,10 @@
-RSpec.shared_examples "each report version" do |language, package_manager|
+RSpec.shared_examples "each report version" do |language, package_manager, branch = 'master'|
[ '1.0', '1.1', '2.0' ].each do |version|
context "when generating a `#{version}` report" do
let(:url) { "https://gitlab.com/gitlab-org/security-products/tests/#{language}-#{package_manager}.git" }
it 'matches the expected report' do
- runner.clone(url)
+ runner.clone(url, branch: branch)
report = runner.scan(env: { 'LM_REPORT_VERSION' => version })
#expect(report).to match_schema(version: version)
expected = JSON.parse(fixture_file_content("expected/#{language}/#{package_manager}/v#{version}.json"))