首页 \ 问答 \ Travis.yml失败与简约内容?(Travis.yml failing with minimalistic contents?)

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
更新时间:2023-01-22 14:01

最满意答案

使用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.shsh 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 is phpunit (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 with

before_install:
  - chmod +x build.sh

You can also make the script bash build.sh or sh build.sh.

相关问答

更多

相关文章

更多

最新问答

更多
  • 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?)