diff options
| author | mo khan <mo.khan@gmail.com> | 2020-07-07 12:16:41 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-07-07 12:16:41 -0600 |
| commit | e9580d91d696577df27718a2f5367b84568f82de (patch) | |
| tree | 9249ef6f652f7a98f7047308d03268db0ed89b41 | |
| parent | 31adddadee3b56d94356d178cc436fdc5dd7455c (diff) | |
Scan project from project directly to match gitlab-runner runtime behaviour
| -rwxr-xr-x | bin/docker-test | 10 | ||||
| -rw-r--r-- | spec/support/integration_test_helper.rb | 11 |
2 files changed, 7 insertions, 14 deletions
diff --git a/bin/docker-test b/bin/docker-test deleted file mode 100755 index c5b0ba1..0000000 --- a/bin/docker-test +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -set -eu - -cd "$(dirname "$0")/.." - -export CI_PROJECT_DIR="$1" - -mkdir -p pkg/ && gem build --silent -o pkg/license-management-test.gem ./*.gemspec -./run.sh analyze "$CI_PROJECT_DIR" diff --git a/spec/support/integration_test_helper.rb b/spec/support/integration_test_helper.rb index 5c9de94..8d5f8b6 100644 --- a/spec/support/integration_test_helper.rb +++ b/spec/support/integration_test_helper.rb @@ -67,12 +67,15 @@ module IntegrationTestHelper end def scan(env: {}) - return {} unless execute(env, './bin/docker-test', project_path.to_s) + execute(env, 'mkdir -p pkg/ && gem build --silent -o pkg/license-management-test.gem ./*.gemspec') + Dir.chdir project_path do + return {} unless execute(env, "#{License::Management.root.join('run.sh')} analyze .") - report_path = project_path.join('gl-license-scanning-report.json') - return {} unless report_path.exist? + report_path = project_path.join('gl-license-scanning-report.json') + return {} unless report_path.exist? - Report.new(report_path.read) + Report.new(report_path.read) + end end def execute(env = {}, *args) |
