
stages:
  - build
  - test

before_script:
  - echo 'drop database if exists irida_test; create database irida_test' | mysql -u test -ptest
  - echo 'db.dropDatabase()' | mongo test
  - pushd lib
  - ./install-libs.sh
  - popd
  - rm -rf /tmp/irida/*

service_job:
#running service layer tests
  script:
  - mvn clean verify -Pservice_testing
  stage: test
ui_job:
#running ui tests
  script:
  - xvfb-run --auto-servernum --server-num=1 mvn clean verify -Pui_testing -Dwebdriver.chrome.driver=./src/main/webapp/node_modules/chromedriver/lib/chromedriver/chromedriver
  stage: test
rest_job:
#running rest api tests
  script:
  - mvn clean verify -Prest_testing
  stage: test
galaxy_job:
#lastly, run all tests involving Galaxy
  script:
  - "scripts/galaxy-docker.sh"
  stage: test
build-docs_job:
  script: "scripts/build-docs.sh"
  stage: build
cache:
  untracked: true
  paths:
    - src/main/webapp/node
    - src/main/webapp/node_modules
    - src/main/webapp/resources/bower_components


stages:
  - build
  - test

before_script:
  - echo 'drop database if exists irida_test; create database irida_test' | mysql -u test -ptest
  - echo 'db.dropDatabase()' | mongo test
  - pushd lib
  - ./install-libs.sh
  - popd
  - rm -rf /tmp/irida/*
  - rm -rf src/main/webapp/node_modules/*

service_job:
#running service layer tests
  script:
  - mvn clean verify -Pservice_testing
  stage: test
ui_job:
#running ui tests
  script:
  - xvfb-run --auto-servernum --server-num=1 mvn clean verify -Pui_testing -Dwebdriver.chrome.driver=./src/main/webapp/node_modules/chromedriver/lib/chromedriver/chromedriver
  stage: test
rest_job:
#running rest api tests
  script:
  - mvn clean verify -Prest_testing
  stage: test
galaxy_job:
#lastly, run all tests involving Galaxy
  script:
  - "scripts/galaxy-docker.sh"
  stage: test
build-docs_job:
  script: "scripts/build-docs.sh"
  stage: build
cache:
  untracked: true
  paths:
    - src/main/webapp/node
    - src/main/webapp/node_modules
    - src/main/webapp/resources/bower_components

Remove the node_modules on start of CI testing
Remove the node_modules on start of CI testing
