user764357
user764357

Reputation:

Travis-CI allow_failures when multiple environment variables are set

I'm trying to set allow_failures for a complex build process, but unfortunately it isn't working.

The problem is that in my env I am setting multiple environment variables, and cannot get Travis to recognise that I want on of these rows to be allowed to fail.

The documentation on allow_failures shows how to allow a single env to fail, along with another configuration option, but doesn't cover how to allow a multiple enviroment variable setup to fail.

The troublesome sections of the .travis.yml file are below:

env:
  - DJANGO_VERSION='1.8,<1.9' DB=sqlitefile   SEARCH=whoosh
  - DJANGO_VERSION='1.8,<1.9' DB=postgres     SEARCH=whoosh
  - DJANGO_VERSION='1.8,<1.9' DB=mysql        SEARCH=whoosh
  - DJANGO_VERSION='1.8,<1.9' DB=sqlitefile   SEARCH=elasticsearch
  - DJANGO_VERSION='1.8,<1.9' DB=postgres     SEARCH=elasticsearch
  - DJANGO_VERSION='1.8,<1.9' DB=mysql        SEARCH=elasticsearch

matrix:
  allow_failures:
    - env: DJANGO_VERSION='1.8,<1.9'  DB=mysql  SEARCH=elasticsearch
    - env: DJANGO_VERSION='1.8,<1.9'  DB=mysql  SEARCH=whoosh

How can I do this?

Upvotes: 1

Views: 347

Answers (1)

user764357
user764357

Reputation:

Fixed!

Travis allow_failure options must be identical down to the whitespace!

So this won't work:

env:
  - FOO='one'      BAR='two'
  - FOO='three'    BAR='four'
matrix:
  allow_failures:
  - env: FOO='one' BAR='two'

But this will:

env:
  - FOO='one'      BAR='two'
  - FOO='three'    BAR='four'
matrix:
  allow_failures:
  - env: FOO='one'      BAR='two'

Upvotes: 2

Related Questions