From 690819209575c28b1d54ac710322dce3356fc1ab Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 20 Apr 2020 22:49:36 -0600 Subject: Make tests runnable --- .gitlab/test.yml | 4 +++- Dockerfile | 3 +-- bin/bootstrap | 4 ++++ bin/setup | 2 +- lib/spandx/gitlab.rb | 2 -- spec/support/integration_test_helper.rb | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 bin/bootstrap diff --git a/.gitlab/test.yml b/.gitlab/test.yml index c7adf56..349b1f0 100644 --- a/.gitlab/test.yml +++ b/.gitlab/test.yml @@ -9,7 +9,9 @@ lint: .rspec: stage: test script: - - bash -lc './bin/test $RSPEC_DIR --format RspecJunitFormatter --out rspec.xml' + - cd /opt/spandx-gitlab + - ./bin/bootstrap + - ./bin/test $RSPEC_DIR --format RspecJunitFormatter --out rspec.xml variables: BUNDLE_JOBS: '2' BUNDLE_PATH: 'vendor/bundle' diff --git a/Dockerfile b/Dockerfile index 4f32182..70118f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,5 +9,4 @@ ENV PATH="/opt/ruby/bin:${HOME}/.local/bin:${PATH}" RUN apt-get update -y && apt-get install -y libgdbm6 wget libssl1.1 libyaml-0-2 libreadline7 libncurses6 libxml2 COPY --from=ruby-builder /opt/ruby /opt/ruby RUN rm /etc/profile -RUN env -RUN spandx help +RUN spandx version diff --git a/bin/bootstrap b/bin/bootstrap new file mode 100644 index 0000000..4d04d7d --- /dev/null +++ b/bin/bootstrap @@ -0,0 +1,4 @@ +#!/bin/sh + +apt-get update -q +apt-get install build-essential diff --git a/bin/setup b/bin/setup index dce67d8..d1c17fc 100755 --- a/bin/setup +++ b/bin/setup @@ -3,6 +3,6 @@ set -euo pipefail IFS=$'\n\t' set -vx -bundle install +bundle install --quiet # Do any other automated setup that you need to do here diff --git a/lib/spandx/gitlab.rb b/lib/spandx/gitlab.rb index 842aa84..287cb0c 100644 --- a/lib/spandx/gitlab.rb +++ b/lib/spandx/gitlab.rb @@ -12,5 +12,3 @@ module Spandx end end end - -puts "YAHOO" diff --git a/spec/support/integration_test_helper.rb b/spec/support/integration_test_helper.rb index 416438e..7e1f23b 100644 --- a/spec/support/integration_test_helper.rb +++ b/spec/support/integration_test_helper.rb @@ -70,7 +70,7 @@ module IntegrationTestHelper def scan(env: {}) command = [ - '/usr/local/bin/ruby -I /opt/spandx-gitlab/lib /usr/local/bin/spandx scan --format=json -r spandx/gitlab -R -l /dev/stderr', + 'ruby -Ilib /opt/ruby/bin/spandx scan --format=json -r spandx/gitlab -R -l /dev/stderr', project_path ].join(' ') return {} unless execute(env, command) -- cgit v1.2.3