summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-04-20 22:49:36 -0600
committermo khan <mo.khan@gmail.com>2020-04-20 22:49:36 -0600
commit690819209575c28b1d54ac710322dce3356fc1ab (patch)
treec5114195c98f99e3a363567fb4ea438d32d7d983
parentfd31a57b1f4fa38499e50112d368becb3c7aaecc (diff)
Make tests runnable
-rw-r--r--.gitlab/test.yml4
-rw-r--r--Dockerfile3
-rw-r--r--bin/bootstrap4
-rwxr-xr-xbin/setup2
-rw-r--r--lib/spandx/gitlab.rb2
-rw-r--r--spec/support/integration_test_helper.rb2
6 files changed, 10 insertions, 7 deletions
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)