Travis-ci测试我排除的选项。我错过了测试矩阵设置的东西,

时间:2013-07-14 20:48:49

标签: travis-ci

出于某种原因Travis-CI运行所有矩阵,包括全部3.3(而不仅仅是vs django 1.6) .travis.yml代码:

language: python
python:
  - "2.6"
  - "2.7"
  - "3.3"
env:
  - DJANGO=Django==1.5.1
  - DJANGO=Django==1.4.3
  - DJANGO=https://www.djangoproject.com/download/1.6b1/tarball/
matrix:
  # since isn't a Django release
  allow failures:
  - env: DJANGO=https://www.djangoproject.com/download/1.6b1/tarball/
  # since most django versions won't work with 3.3. excluded won't run on the matrix
  exclude:
  - python: "3.3"
  #the only version of django that's supposed to support 3.3
  include:
  - python: "3.3"
    env: DJANGO=https://www.djangoproject.com/download/1.6b1/tarball/

install:
  - pip install -q $DJANGO --use-mirrors
  - pip install -r requirements.txt --use-mirrors
  - pip install -q django-setuptest --use-mirrors
script:
  - python setup.py test
我错过了什么?谢谢你的帮助

1 个答案:

答案 0 :(得分:1)

你可以这样做:

language: python
python:
  - "2.6"
  - "2.7"
env:
  - DJANGO=Django==1.5.1
  - DJANGO=Django==1.4.3
  - DJANGO=https://www.djangoproject.com/download/1.6b1/tarball/
matrix:
  # since isn't a Django release
  allow_failures:
  - env: DJANGO=https://www.djangoproject.com/download/1.6b1/tarball/
  #the only version of django that's supposed to support 3.3
  include:
  - python: "3.3"
    env: DJANGO=https://www.djangoproject.com/download/1.6b1/tarball/

install:
  - pip install -q $DJANGO --use-mirrors
  - pip install -r requirements.txt --use-mirrors
  - pip install -q django-setuptest --use-mirrors
script:
  - python setup.py test

基本上,对于每个matrix.exclude,您必须为作业指定整个配置。因此,要删除3.3作业中的一个,您将执行此操作:

matrix:
  exclude:
    - python: "3.3"
      env: DJANGO=Django==1.5.1

然后您还必须为1.4.3添加另一个。只需从"3.3"移除python即可,因为无论如何它都会添加matrix.include