Travis.yml失败与简约内容?(Travis.yml failing with minimalistic contents?)
我的Github上有当前的
travis.yml
:# see http://about.travis-ci.org/docs/user/languages/php/ for more hints language: php # list any PHP version you want to test against php: # aliased to a recent 5.4.x version - 5.4 # aliased to a recent 5.5.x version - 5.5
我所有的工作都失败了,但是用简约的构建,我看不出为什么失败..由于Travis不完全具备最好的信息..以下是我的日志的最后几个块:
工作9.1:
$ git clone --depth=50 --branch=master git://github.com/SlayerSolutions/Authentication.git SlayerSolutions/Authentication Cloning into 'SlayerSolutions/Authentication'... remote: Counting objects: 128, done. remote: Compressing objects: 100% (104/104), done. remote: Total 128 (delta 55), reused 83 (delta 15) Receiving objects: 100% (128/128), 19.17 KiB | 0 bytes/s, done. Resolving deltas: 100% (55/55), done. $ cd SlayerSolutions/Authentication git.2 $ git checkout -qf 1df78d018dbe8a81e66490e90012229adcff7af8 $ phpenv global 5.4 $ php --version PHP 5.4.16 (cli) (built: Jun 28 2013 11:14:20) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.1, Copyright (c) 2002-2012, 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.4.16/bin/composer.phar self-update" to get the latest version. Composer version 7755564962718189d5d7d9fdee595283c8f032b7 $ phpunit PHPUnit 3.7.21 by Sebastian Bergmann. Usage: phpunit [switches] UnitTest [UnitTest.php] phpunit [switches] <directory> --log-junit <file> Log test execution in JUnit XML format to file. ...Bla,bla,bla The command "phpunit" exited with 2. Done. Your build exited with 1.
和工作9.2:
是相同的,结束于:
The command "phpunit" exited with 2. Done. Your build exited with 1.
那么,这里出了什么问题?
I have the current
travis.yml
on my Github:# see http://about.travis-ci.org/docs/user/languages/php/ for more hints language: php # list any PHP version you want to test against php: # aliased to a recent 5.4.x version - 5.4 # aliased to a recent 5.5.x version - 5.5
All my jobs keep failing, but with a minimalistic build, i Cannot see why it fails.. As Travis doesn't exactly have the best information.. Here is the last few chunks of my logs:
Job 9.1:
$ git clone --depth=50 --branch=master git://github.com/SlayerSolutions/Authentication.git SlayerSolutions/Authentication Cloning into 'SlayerSolutions/Authentication'... remote: Counting objects: 128, done. remote: Compressing objects: 100% (104/104), done. remote: Total 128 (delta 55), reused 83 (delta 15) Receiving objects: 100% (128/128), 19.17 KiB | 0 bytes/s, done. Resolving deltas: 100% (55/55), done. $ cd SlayerSolutions/Authentication git.2 $ git checkout -qf 1df78d018dbe8a81e66490e90012229adcff7af8 $ phpenv global 5.4 $ php --version PHP 5.4.16 (cli) (built: Jun 28 2013 11:14:20) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.1, Copyright (c) 2002-2012, 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.4.16/bin/composer.phar self-update" to get the latest version. Composer version 7755564962718189d5d7d9fdee595283c8f032b7 $ phpunit PHPUnit 3.7.21 by Sebastian Bergmann. Usage: phpunit [switches] UnitTest [UnitTest.php] phpunit [switches] <directory> --log-junit <file> Log test execution in JUnit XML format to file. ...Bla,bla,bla The command "phpunit" exited with 2. Done. Your build exited with 1.
and Job 9.2:
Is the same and ends with:
The command "phpunit" exited with 2. Done. Your build exited with 1.
So, what is going wrong here?
原文:https://stackoverflow.com/questions/18244455
最满意答案
使用Travis运行的脚本的任何非零退出代码都被视为失败。 您的minimalistic
.travis.yml
不指定构建脚本,因此运行PHP的默认构建脚本,即phpunit
( 另请参阅文档 )。由于您的存储库中没有phpunit.xml,因此Travis基本上没有运行。 这导致失败的构建。
这真的取决于你想用Travis做什么,但是要么根据默认配置你的存储库,要么在运行构建时定义脚本来执行,如下所示:
language: php php: - 5.4 - 5.5 script: ./build.sh
然后你可以在
build.sh
指定任何你想要在运行构建时被执行的东西。您可能需要确保
./build.sh
是可执行的,您可以执行此操作before_install: - chmod +x build.sh
你也可以使脚本
bash build.sh
或sh build.sh
。Any non-zero exit code of the scripts you run with Travis are considered a failure. Your minimalistic
.travis.yml
does not specify a build script, therefore the default build script for PHP is run, which isphpunit
(see also the documentation).As you don't have a phpunit.xml in your repository, there is basically nothing to run for Travis. This leads to the failing build.
It really depends what you want to do with Travis, but either you configure your repository according to the default or define a script to execute when running the build like this:
language: php php: - 5.4 - 5.5 script: ./build.sh
Then you can specify whatever you want in the
build.sh
to be executed when running build.You may need to insure that
./build.sh
is executable which you can do withbefore_install: - chmod +x build.sh
You can also make the script
bash build.sh
orsh build.sh
.
相关问答
更多-
travis.yml 是什么文件[2022-05-27]
travis 的配置文件,travis 是一种可持续集成(CI)工具,代码提交后自动构建,与github集成的很好,很多github的开源项目都使用 travis 进行CI。www.travis-ci.org -
你的命令有两个问题。 首先, ^表示它只匹配COVERALLS_TOKEN ,它出现在一行的最开头。 由于它不在YAML文件中的行的开头,因此没有匹配,并且sed命令不执行任何操作。 其次,单引号内没有变量替换。 所以删除^并使用双引号而不是单引号: sed -ri "s/COVERALLS_TOKEN/$COVERALLS_TOKEN/" .coveralls.yml 一些说明: 必须在运行sed命令时在shell中设置变量$COVERALLS_TOKEN 。 如果$COVERALLS_TOKEN的值包 ...
-
找到可用模拟器的技巧正在运行: $ xcrun instruments -s devices 您将看到已安装设备的属性: Known Devices: Travis’s Mac (129) [00000000-0000-1000-8000-005056A6DCD8] iPad 2 (8.1) [22540C0C-46B4-4FF8-9B74-6321081CA975] iPad 2 (8.2) [03655E8B-725B-4C03-A505-8EEA0BE5A966] iPad 2 (8.3) [BBC ...
-
如何修复travis.yml中拒绝的gradlew权限?(How to fix gradlew permission denied in travis.yml? [duplicate])[2019-11-27]
我想你可以在你的travis.yml文件中添加这样的travis.yml : before_install: - chmod +x gradlew I guess you can add something like this to your travis.yml file: before_install: - chmod +x gradlew -
运行脚本有条件地在travis.yml中不起作用,为什么?(Running script conditionally does not work in travis.yml, why?)[2021-12-08]
您对YAML语法做出了一些假设,这些假设会导致您的问题。 如果您通过缩进后续行来“放出”一行YAML,如下所示: - The quick brown fox jumped over the lazy dog. 这完全像你,而是写这个: - The quick brown fox jumped over the lazy dog. 这意味着你的shell片段,你写成: - if [ $TRAVIS_BRANCH == "master" && $TRAVIS_PULL_REQUEST == "f ... -
phpunit退出时出错,因为你没有告诉phpunit在哪里寻找你的测试。 通常,您可以通过将phpunit.xml放在phpunit.xml的基目录中来完成此操作。 除其他外, phpunit.xml告诉phpunit哪个目录包含您的测试。 你的phpunit.xml应该包含这样的东西:我看了一下,你遇到的实质上是我们的YAML解析处理重复键的一个错误 。 解决我们如何处理这个问题是我们正在努力的方向。 你有两个addons:你的.travis.yml文件中的键 https://github.com/orientation/orientation/blob/f9850e86a97eff77298f54ce68ca0a07c173e81a/.travis.yml#L6-L7 https://github.com/orientation/orientation/blob/f9850e86a97 ...来自http://docs.travis-ci.com/user/customizing-the-build/ : Travis CI在存储库的根目录中使用.travis.yml文件来了解您的项目以及您希望如何执行构建。 可以在单个.travis.yml文件中使用matrix和allow_failures混合来解决您运行两个作业的用例,其中一个构建报告您的功能测试,第二个构建为您提供有关pep8合规性的反馈, 例如,以下.travis.yml文件导致在traivs上发生两个构建。 在仅一个构建中(即PEP= ...使用Travis运行的脚本的任何非零退出代码都被视为失败。 您的minimalistic .travis.yml不指定构建脚本,因此运行PHP的默认构建脚本,即phpunit ( 另请参阅文档 )。 由于您的存储库中没有phpunit.xml,因此Travis基本上没有运行。 这导致失败的构建。 这真的取决于你想用Travis做什么,但是要么根据默认配置你的存储库,要么在运行构建时定义脚本来执行,如下所示: language: php php: - 5.4 - 5.5 script: ./bui ...看起来失败的构建是在名为doc-update的不同分支上运行的,默认情况下我们不会阻止它,因为它没有命名为gh-pages 我们可以通过启用我们的设置仅在其上具有.travis.yml文件的分支上运行构建来实现此目的,如下面的屏幕转换所示 It looks like the build that failed was run on a different branch named doc-update, which we wouldn't block by default, as it's not name ...
相关文章
更多- file_get_contents 无法读取https的问题解决!
- 如何获取iframe刷新后的内容
- Chef基础
- MapReduce错误任务失败处理
- Solr PHP support
- Hadoop1.0.3 Namenode启动失败
- 双开微信历程....最终失败....
- 崩溃了,android 创建表失败。。 大家看看吧。。。
- Hadoop 任务失败超过重试次数的处理方法
- struts2校验失败后,数据不存在的问题
最新问答
更多- Apache HttpClient(4.1和更新版本):如何进行基本身份验证?(Apache HttpClient (4.1 and newer): how to do basic authentication?)
- 复选框不适用于模态(Checkbox does not work in modal)
- 当使用大标题无法正常工作时,iOS 11会滚动到顶部(iOS 11 scroll to top when using large titles doesn't work properly)
- 为什么我的Arduino不能超过10?(Why can't my Arduino compare above 10?)
- 从Lib中删除PDB文件/功能(Remove the PDB file/functionality from Lib)
- rails-2.3.5和rack-1.0.1的来源在哪里?(Where are the sources for rails-2.3.5 and rack-1.0.1?)
- 如何使用List <>成员不可变的类?(How to make a class with List<> member immutable?)
- Microsoft Edge popup扩展如何获取后台页面?(Microsoft Edge popup extension how to get backgroundpage?)
- python删除中文unicode字符串之间的空格,但不删除英文单词之间的空格(python to remove space between Chinese unicode strings but not between English words)
- SBT:如何Dockerize一个胖罐子?(SBT: How to Dockerize a fat jar?)
- 如何从服务器请求中保存图像的分区以便以后合并(How to save segements of image in memory from server request for merging later)
- python这段程序中a=self.[:]是什么意思 self一般用法是啥
- ActiveRecord :: StatementInvalid:PGError:错误:关系“指令”不存在(ActiveRecord::StatementInvalid: PGError: ERROR: relation “instructions” does not exist)
- 虚拟机安装kail linux最低配置是多少?
- fread()中的空字符和c中的strncpy()(Null character in fread() and strncpy() in c)
- 从ShutdownHook中查找程序退出的原因(Find, from a ShutdownHook, why a program exits)
- 每天在固定时间运行任务(Run a task at fixed time everyday)
- 电脑开不了机了,开机后进了桌面,显示WINDOWS BOOT MANAGER
- 获取字符串第n个出现的索引?(Get the index of the nth occurrence of a string?)
- python selenium 怎么打开 Chrome 并且能设置代理,请问可以指导小弟一下吗。
- 错误:imagecopymerge()期望参数2是资源(Error: imagecopymerge() expects parameter 2 to be resource)
- 在我的代码中,“无法找到可安装的ISAM”错误的原因是什么?(What could be the cause of 'Could not find installable ISAM' error in my code?)
- Access 2013 - 没有自动编号的顺序编号(Access 2013 - sequential numbering without autonumber)
- 将带有函数的Javascript对象转换为字符串(Converting a Javascript Object with Functions into a String)
- Java中实现封装与信息隐藏与抽象与隐藏数据的比较(Practical example Encapsulation vs Information Hiding vs Abstraction vs Data Hiding in Java)
- 不要包必须匹配java文件所在的子目录吗?(Don't packages have to match the subdirectories the java file is in?)
- PyCharm Python控制台中的文件路径错误(File path wrong in PyCharm Python Console)
- 在数据框列上应用curve_fit(Apply curve_fit on dataframe columns)
- Java中的DateTime.FromOADate()相当于什么(Java中的Datetime是Datetime的两倍)(What is the equivalent of DateTime.FromOADate() in Java (double to Datetime in Java))
- 给定DCEL,其中双胞胎等于下一个边缘,细分可以有多少面?(Given a DCEL where the twin is equal to the next of an edge, how many faces can the subdivision have?)