duanliao6789 2014-06-08 12:58
浏览 75

Travis错误地给出了失败的测试

I am new to travis-ci, but I can't understand why a test that passes is failing.

Here is the scenario. I have a repo in github, structured this way

 src/
   repo_name/
      /foo.class.php

test/
  bootstrap.php
  repo_name/
      testFoo.class.php
.travis.yml
phpunit.xml
composer.json

Here is the contents of .travis.yml

language: php
php:
  - 5.5
  - 5.4

And here is content of phpunit.xml

<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         syntaxCheck="false"
         bootstrap="test/bootstrap.php"
        >
    <testsuites>
        <testsuite name="First Tests">
            <directory>./test/</directory>
        </testsuite>
    </testsuites>

    <filter>
        <whitelist>
            <directory>./src/</directory>
        </whitelist>
    </filter>
</phpunit>

boostrap.php only requires the src/repo_name/foo.class.php testFoo.class.php has the standard PHPUnit test method.

I don't really think there is anything wrong with the my files, because I have run the tests many time, and it works without any problem. I get fail/pass messages correctly.

What could be going wrong?

UPDATE

This is the error message, I am getting from travis

Using worker: worker-linux-8-1.bb.travis-ci.org:travis-linux-20

git.1

$ git clone --depth=50 --branch=master git://github.com/repo_name/repo_name.git repo_name/repo_name

Cloning into 'repo_name/repo_name'...

remote: Counting objects: 252, done.

remote: Compressing objects: 100% (216/216), done.

remote: Total 252 (delta 89), reused 2 (delta 0)

Receiving objects: 100% (252/252), 51.10 KiB | 0 bytes/s, done.

Resolving deltas: 100% (89/89), done.

Checking connectivity... done.

$ cd repo_name/repo_name
git.3

$ git checkout -qf 1689bb68fb95a52d859fdc7c309a9c5f41c6df85

$ phpenv global 5.5

$ php --version

PHP 5.5.11 (cli) (built: May 1 2014 01:40:45)

Copyright (c) 1997-2014 The PHP Group

Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

with Xdebug v2.2.4, Copyright (c) 2002-2014, by Derick Rethans

$ composer --version

Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/home/travis/.phpenv/versions/5.5/bin/composer self-update" to get the latest version.

Composer version 6ffd34db9054fe89e5d3b51f6b4178c9010b4afa 2014-04-30 11:03:37
before_install

$ git submodule update --init --recursive

$ phpunit

PHPUnit 4.0.19 by Sebastian Bergmann.

Cannot open file "/home/travis/build/repo_name/repo_name/test/bootstrap.php".

The command "phpunit" exited with 1.

Done. Your build exited with 1.
  • 写回答

1条回答 默认 最新

  • dpb42021 2015-03-03 07:31
    关注

    It has to be that it wasn't able to include the bootstrap file. Cannot open file "/home/travis/build/repo_name/repo_name/test/bootstrap.php".

    Instead of just putting script: phpunit in .travis.yml, I would put:

    script: phpunit --configuration phpunit.xml

    I've tested this and it works with your setup.

    评论

报告相同问题?

悬赏问题

  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图