Debug .gitlab-ci.yml

I can’t get debugging .gitlab-ci.yml working: I have a very basic .gitlab-ci.yml file containing a run tests job. When I run gitlab-runner exec docker 'run tests', there’s no output (even if I make the test fail. How can I make gitlab-runner actually run?

.gitlab-ci.yml:

image: azul/zulu-openjdk-debian:8

variables
  DEBIAN_FRONTEND: "noninteractive"

before_script:
  - apt-get update -y
  - apt-get -qq -y install curl
  - curl -fsSLo boot https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh && chmod 755 boot

stages:
  - test
  - deploy

check sources:
  stage: test
  script:
    - boot check-sources

run tests:
  stage: test
  script:
    - boot test
$ gitlab-runner exec docker 'run tests'
$ 

I expect some output here…

I tried to run gitlab-runner plain:

$ gitlab-runner --debug run 'run tests'

hangs for at least 10 minutes…

What happens when you manually start azul/zulu-openjdk-debian:8 like:

docker run -it azul/zulu-openjdk-debian:8 bash

And execute your before_script and run tests job scripts manually?

Well, that worked. I found out that it was lack of an : in the script. It would be nice to have feedback, being, that the yml file is not well-formatted.
However, there’s another issue: I have a failed test. Running it locally gives this:

$ boot test

Testing platform.core-test

FAIL in (a-test) (core_test.clj:7)
FIXME, I fail.
expected: 0
  actual: 1
    diff: - 0
          + 1

Testing platform.core

Ran 1 tests containing 1 assertions.
1 failures, 0 errors.
                              java.lang.Thread.run              Thread.java:  745
java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java:  617
 java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java: 1142
               java.util.concurrent.FutureTask.run          FutureTask.java:  266
                                               ...                               
               clojure.core/binding-conveyor-fn/fn                 core.clj: 1938
                                 boot.core/boot/fn                 core.clj: 1029
                               boot.core/run-tasks                 core.clj: 1019
                 adzerk.boot-test/eval137/fn/fn/fn            boot_test.clj:  105
                 adzerk.boot-test/eval200/fn/fn/fn            boot_test.clj:  184
                              clojure.core/ex-info                 core.clj: 4617
clojure.lang.ExceptionInfo: Some tests failed or errored
    error: 0
     fail: 1
     pass: 0
     test: 1
     type: :summary
clojure.lang.ExceptionInfo: Some tests failed or errored
    file: "/tmp/boot.user4782064585789575203.clj"
    line: 27
$ 

However, in gitlab, it gives:

$ boot test
Downloading https://github.com/boot-clj/boot/releases/download/2.5.2/boot.jar...
Running for the first time, BOOT_VERSION not set: updating to latest.
Retrieving boot-2.7.1.jar from https://clojars.org/repo/
Retrieving clojure-1.8.0.jar from https://repo1.maven.org/maven2/
#http://boot-clj.com
#Tue Mar 28 13:43:57 UTC 2017
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_VERSION=2.7.1
BOOT_CLOJURE_VERSION=1.8.0

It doesn’t seem to run the tests, or logging is not shown, but more importantly, it’s not failing on the tests, while clearly, (= 0 1) is not true.

How is that possible?

First: There is a CI lint tool available inside Gitlab, check this (second last paragraph).

Second; I have no knowledge of Boot or what it does. Maybe the path of execution isn’t right and no tests are found or something?

It’s because it couldn’t find the empty resources directory which wasn’t pushed to gitlab ('cause it’s empty, which makes perfect sense)… However, again, there’s no feedback why something doesn’t work as expected. It really would help a lot to have that feedback. Anyway, got it solved. Thanks!