首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Travis CI - Builds超时

Travis CI - Builds超时
EN

Stack Overflow用户
提问于 2015-06-24 01:03:09
回答 1查看 2K关注 0票数 2

我的.travis.yml

代码语言:javascript
复制
language: node_js
node_js:
  - "0.12"
before_install:
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"

到目前为止,我只添加了几个非常简单的测试(检查类属性是否存在)。我可以看到测试已经执行了。

然后,Travis输出中的最后几行如下:

代码语言:javascript
复制
WARN [web-server]: 404: /css/style.min.css?1435068425.642
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated

如果测试正在运行,那么构建和依赖项一定已经安装好了?那么,为什么在执行完所有测试之后,该过程还没有完成呢?

karma.config:

代码语言:javascript
复制
module.exports = function(config) {
  config.set({
    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',
    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: [
        'jasmine',
        'requirejs'
    ],
    // list of files / patterns to load in the browser
    files: [
      {pattern: 'js/vendor/**/*.js', included: false},
      {pattern: 'js/*.js', watched: true, included: false},
      {pattern: 'test/**/*Spec.js', watched: true, included: false},
      {pattern: 'css/**/*.css', included: false},
      'test/test-main.js'
    ],
    // list of files to exclude
    exclude: [
        'test/lib/**/*.js',
        'js/vendor/**/test/*.js', //do not include the vendor tests
        'js/_admin.js'
    ],
    preprocessors: {
    },
    reporters: ['progress'],
    // web server port
    port: 9876,
    // enable / disable colors in the output (reporters and logs)
    colors: true,
    // level of logging
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Firefox'], //'Chrome', 'PhantomJS', 'PhantomJS_custom'
    singleRun: false,
  });//config.set
};//module.exports

文件夹test中的test-main.js:

代码语言:javascript
复制
var allTestFiles = [];
var TEST_REGEXP = /(spec|test)\.js$/i;

Object.keys(window.__karma__.files).forEach(function(file) {
    if (TEST_REGEXP.test(file)) {
        // Normalize paths to RequireJS module names.
        allTestFiles.push(file);
    }
    //console.log('test files:', allTestFiles);
});

require.config({
    baseUrl: '/base',
    paths: {
        'jquery': './js/vendor/jquery/jquery-2.1.4.min',
        'jquery-ui': './js/vendor/jquery-ui-1.11.4.custom/jquery-ui.min',
        'underscore': './js/vendor/underscore/underscore-min',
        'backbone': './js/vendor/backbone/backbone-min',
        'mustache': './js/vendor/mustache/mustache.min',
        'domReady': './js/vendor/requirejs/plugins/domReady/domReady',
        'text': './js/vendor/requirejs/plugins/text/text',
        //------------------------------------
        //custom requireJS application modules
        'my': './js/my',
        'my-CSS': './js/my-CSS'
    },
    shim: {
        'underscore': {
            exports: '_'
        }
    },
    deps: allTestFiles,
    callback: window.__karma__.start
});

my-CSS模块加载css,如下所示:

代码语言:javascript
复制
//custom requireJS module to hold the crowdUI class
define(["my"], function (my) { //prerequisites
    'use strict';
    //load the CSS definitions
    document.head.appendChild(
        my.createElement('link', {
            attribute: {
                id: 'my-CSS',
                href: './css/style.min.css?' + crowdUI.TIMESTAMP,
                rel: 'stylesheet',
                type: 'text/css'
            }
        })
    );

});
EN

回答 1

Stack Overflow用户

发布于 2015-09-24 06:30:27

如果问题只是您的任务需要超过10分钟,在此期间它不会产生任何输出,解决方法很简单:在命令前面加上travis_wait

例如,不仅仅是myCommand,而是travis_wait myCommand

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31009049

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档