title: SpringBoot and GitLab CI to run tests
body: <p>I would like to just use GitLab CI to run test only not to deploy my app. I manage to assembly this <code>.yml</code> file:</p>
  
  <pre><code>image: java:8
  
  stages:
    - build
    - test
  
  build:
    stage: build
    script: ./gradlew build
    artifacts:
      paths:
        - build/libs/myApp-4.0.0-SNAPSHOT.jar
  
  unitTests:
    stage: test
    script:
      - ./gradlew test
  </code></pre>
  
  <p>And in the GitLab Pipeline I get the following error:</p>
  
  <blockquote>
    <p>ar.com.sebasira.myApp.myAppApplicationTests > contextLoads FAILED
    java.lang.IllegalStateException
    Caused by: org.springframework.beans.factory.BeanCreationException
    Caused by: org.springframework.beans.BeanInstantiationException
    Caused by: org.springframework.beans.factory.BeanCreationException
    Caused by: org.springframework.beans.BeanInstantiationException
    Caused by: org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException</p>
  </blockquote>
  
  <p>I'm guessing this could be related to database, right? I need to provide that database with credentials in my Server where the runner is?</p>
  
  <p>If so, how should I do it? I'currently using <code>application.properties</code> file to define the connection to the DB. </p>
  
  <p>And one more question... in the <code>.gitlab-ci.yml</code> file I need to put the path to the <code>.jar</code> but that filename will change everytime I update the version of my app. Do I need to manually change it?</p>