• Mahmood Ali's avatar
    ci: use gotestsum for running tests · 8b53ff97
    Mahmood Ali authored
    `gotestsum` has user friendlier output that emits final summary, also it can emit junit xml file for
    automated analysis instead of current format that should significantly
    ease automated analysis of CI.
    8b53ff97
.travis.yml 1.62 KiB
services:
    - docker

language: go

go:
  -  "1.x"

addons:
  chrome: stable

git:
  depth: 300

matrix:
  include:
    - os: linux
      dist: xenial
      sudo: required
    - os: linux
      dist: xenial
      sudo: required
      env: ENABLE_RACE=1
    - os: linux
      dist: xenial
      sudo: false
      env: RUN_WEBSITE_TESTS=1 SKIP_NOMAD_TESTS=1
    - os: linux
      dist: xenial
      sudo: false
      env: RUN_UI_TESTS=1 SKIP_NOMAD_TESTS=1
    - os: linux
      dist: xenial
      sudo: false
      env: RUN_STATIC_CHECKS=1 SKIP_NOMAD_TESTS=1
    - os: osx
      osx_image: xcode9.1
    - os: linux
      dist: xenial
      sudo: required
      env: RUN_E2E_TESTS=1 SKIP_NOMAD_TESTS=1
  allow_failures:
    # Allow osx to fail as its flaky
    - os: osx
    #FIXME Allow race enabled builds to fail for now.
    - env: ENABLE_RACE=1
  fast_finish: true

before_install:
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ -z "$SKIP_NOMAD_TESTS" ]]; then sudo -E bash ./scripts/travis-mac-priv.sh ; fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ -z "$SKIP_NOMAD_TESTS" ]]; then sudo -E bash ./scripts/travis-linux.sh ; fi
  - if [[ "$RUN_UI_TESTS" ]]; then curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.0.1 ; fi
  - if [[ "$RUN_UI_TESTS" ]]; then export PATH="$HOME/.yarn/bin:$PATH" ; fi

install:
  - if [[ -z "$SKIP_NOMAD_TESTS" ]]; then make deps ; fi
  - if [[ "$RUN_STATIC_CHECKS" ]]; then make lint-deps ; fi
  - if [[ "$RUN_UI_TESTS" ]]; then . $HOME/.nvm/nvm.sh && cd ui && nvm use && cd .. ; fi

script:
  - sudo -E "PATH=$PATH" GOTESTSUM_JUNITFILE=/tmp/results.xml make travis

after_script:
  - cat /tmp/results.xml