diff options
| author | mo khan <mo.khan@gmail.com> | 2020-05-28 12:44:01 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-05-29 00:57:47 -0600 |
| commit | a8d9eac2cbe0c7863fc43d04d4a5be1c239be681 (patch) | |
| tree | a4a431995d918b63e33d3dc5f1ad83fba00041a4 /spec/integration | |
| parent | 0b976fcffe0a9b8e80587adb076bcdf279c9331c (diff) | |
Allow custom conan configuration
* Use git fetch with a depth of 1
* Control Conan environment via environment variables
* Allow specifying a custom CONAN_LOGIN_USERNAME and CONAN_PASSWORD
* Specify a default CONAN_CACERT_PATH to point the system cert file
* Tie CONAN_LOGGING_LEVEL to LOG_LEVEL
* Tag and skip offline environment tests because it was shutdown
* Add CHANGELOG entry
Diffstat (limited to 'spec/integration')
| -rw-r--r-- | spec/integration/c/conan_spec.rb | 28 | ||||
| -rw-r--r-- | spec/integration/java/gradle_spec.rb | 2 | ||||
| -rw-r--r-- | spec/integration/java/maven_spec.rb | 2 | ||||
| -rw-r--r-- | spec/integration/js/bower_spec.rb | 2 | ||||
| -rw-r--r-- | spec/integration/js/npm_spec.rb | 2 | ||||
| -rw-r--r-- | spec/integration/js/yarn_spec.rb | 2 | ||||
| -rw-r--r-- | spec/integration/python/pip_spec.rb | 2 | ||||
| -rw-r--r-- | spec/integration/python/pipenv_spec.rb | 2 |
8 files changed, 35 insertions, 7 deletions
diff --git a/spec/integration/c/conan_spec.rb b/spec/integration/c/conan_spec.rb index 3c2ac45..8ada9bc 100644 --- a/spec/integration/c/conan_spec.rb +++ b/spec/integration/c/conan_spec.rb @@ -61,4 +61,32 @@ RSpec.describe "conan" do specify { expect(subject.licenses_for('protobuf')).to match_array(['BSD-3-Clause']) } specify { expect(subject.licenses_for('protoc_installer')).to match_array(['BSD-3-Clause']) } end + + context "when pulling packages from a custom conan remote" do + subject { runner.scan } + + let(:package_name) { "#{project_namespace.tr('/', '+')}+#{project_name}/stable" } + let(:project_namespace) { ENV.fetch('CI_PROJECT_NAMESPACE', 'gitlab-org/security-products') } + let(:project_name) { ENV.fetch('CI_PROJECT_NAME', 'license-management') } + let(:api_url) { ENV.fetch('CI_API_V4_URL', 'https://gitlab.com/api/v4') } + + before do + runner.mount(dir: fixture_file('c/conan/example-project')) + runner.add_file('conanfile.txt', fixture_file_content('c/conan/example-project/conanfile.txt.erb', package_name: package_name)) + runner.add_file('.conan/remotes.json') do + JSON.pretty_generate({ + remotes: [ + { + name: 'gitlab', + url: "#{api_url}/packages/conan", + verify_ssl: true + } + ] + }) + end + end + + specify { expect(subject).to match_schema } + specify { expect(subject.dependency_names).to match_array(['example']) } + end end diff --git a/spec/integration/java/gradle_spec.rb b/spec/integration/java/gradle_spec.rb index 25336c1..0e71038 100644 --- a/spec/integration/java/gradle_spec.rb +++ b/spec/integration/java/gradle_spec.rb @@ -49,7 +49,7 @@ plugins { end end - context 'when scanning a project that needs to connect to multiple TLS endpoints with different custom certificate chains' do + context 'when scanning a project that needs to connect to multiple TLS endpoints with different custom certificate chains', environment: 'offline' do subject do runner.scan(env: { 'ADDITIONAL_CA_CERT_BUNDLE' => fixture_file_content('java/gradle/offline-environment/bundle.crt'), diff --git a/spec/integration/java/maven_spec.rb b/spec/integration/java/maven_spec.rb index fa57752..85637b2 100644 --- a/spec/integration/java/maven_spec.rb +++ b/spec/integration/java/maven_spec.rb @@ -80,7 +80,7 @@ RSpec.describe "maven" do end end - context "when connecting to a custom package registry with a self signed certificate" do + context "when connecting to a custom package registry with a self signed certificate", environment: 'offline' do let(:bundle) { fixture_file_content('java/maven.crt') } let(:report) { runner.scan(env: { 'ADDITIONAL_CA_CERT_BUNDLE' => bundle, 'LOG_LEVEL' => 'debug' }) } diff --git a/spec/integration/js/bower_spec.rb b/spec/integration/js/bower_spec.rb index 5a4f72d..cc7cf9d 100644 --- a/spec/integration/js/bower_spec.rb +++ b/spec/integration/js/bower_spec.rb @@ -24,7 +24,7 @@ RSpec.describe "bower" do specify { expect(subject.licenses_for('stimulus.umd')).to match_array(['unknown']) } end - context "when scanning a bower project with a dependency from a custom npm registry" do + context "when scanning a bower project with a dependency from a custom npm registry", environment: 'offline' do subject { runner.scan(env: { 'ADDITIONAL_CA_CERT_BUNDLE' => fixture_file_content('js/custom-npm.crt') }) } before do diff --git a/spec/integration/js/npm_spec.rb b/spec/integration/js/npm_spec.rb index 13cbd15..abc6fc0 100644 --- a/spec/integration/js/npm_spec.rb +++ b/spec/integration/js/npm_spec.rb @@ -465,7 +465,7 @@ RSpec.describe "npm" do end end - context "when scanning a project with dependencies sourced from a custom registry" do + context "when scanning a project with dependencies sourced from a custom registry", environment: 'offline' do subject { runner.scan(env: { 'ADDITIONAL_CA_CERT_BUNDLE' => fixture_file_content('js/custom-npm.crt') }) } before do diff --git a/spec/integration/js/yarn_spec.rb b/spec/integration/js/yarn_spec.rb index a5a9695..bacac47 100644 --- a/spec/integration/js/yarn_spec.rb +++ b/spec/integration/js/yarn_spec.rb @@ -150,7 +150,7 @@ RSpec.describe "yarn" do end end - context "when scanning a project with dependencies sourced from a custom registry" do + context "when scanning a project with dependencies sourced from a custom registry", environment: 'offline' do subject { runner.scan(env: { 'ADDITIONAL_CA_CERT_BUNDLE' => fixture_file_content('js/custom-npm.crt') }) } before do diff --git a/spec/integration/python/pip_spec.rb b/spec/integration/python/pip_spec.rb index f47bbe6..0ba3d0e 100644 --- a/spec/integration/python/pip_spec.rb +++ b/spec/integration/python/pip_spec.rb @@ -127,7 +127,7 @@ RSpec.describe "pip" do end end - context "when connecting to a private package repository with self signed certificate" do + context "when connecting to a private package repository with self signed certificate", environment: 'offline' do let(:index_url) { "https://#{private_pypi_host}/simple" } let(:bundle) { fixture_file_content('python/pypi.crt') } diff --git a/spec/integration/python/pipenv_spec.rb b/spec/integration/python/pipenv_spec.rb index ccc2585..b95f1fa 100644 --- a/spec/integration/python/pipenv_spec.rb +++ b/spec/integration/python/pipenv_spec.rb @@ -202,7 +202,7 @@ RSpec.describe "pipenv" do end end - context "when connecting to a private package repository with self signed certificate" do + context "when connecting to a private package repository with self signed certificate", environment: 'offline' do let(:index_url) { "https://#{private_pypi_host}/simple" } let(:bundle) { fixture_file_content('python/pypi.crt') } |
