diff options
| author | mo khan <mo.khan@gmail.com> | 2020-03-04 11:58:55 -0700 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-03-04 11:58:55 -0700 |
| commit | 5957399681c8de847dbc062ca8d8e559fb38eb55 (patch) | |
| tree | 75c14977cb75bee3eaa57d907aa9fc0fc04b76de /spec | |
| parent | f21567cf14e242715e0be1337cf762f68866c1dd (diff) | |
Convert pipenv qa jobs to integration tests
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/integration/python/pipenv_spec.rb | 2 | ||||
| -rw-r--r-- | spec/support/integration_test_helper.rb | 4 | ||||
| -rw-r--r-- | spec/support/shared.rb | 4 |
3 files changed, 6 insertions, 4 deletions
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")) |
