2013-07-14 38 views
0

出於某種原因特拉維斯-CI運行所有包括所有3.3(不僅是VS的Django 1.6)矩陣 的.travis.yml代碼:Travis-ci測試我排除的選項。我想的東西的測試矩陣設定,

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

你可以做這樣的:

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另一個爲好。只需從python中刪除"3.3"就容易了,因爲無論如何它都會與matrix.include一起添加。

+0

謝謝@henrikhodne,我認爲包括和排除應該在文檔中更好地解釋..你認爲我應該提出這樣的拉請求嗎? – alonisser

+0

我們很樂意提出有關文檔建議的請求。我們也想自己改善它們,但聽到關於不知道代碼的人們(如文檔的目標受衆)如何解釋某些東西的建議,我們很高興。我們的文檔庫位於https://github.com/travis-ci/travis-ci.github.com。 – henrikhodne