2016-10-27 3 views
0

私はJenkinsサーバーを構成してKarma JSでJSプロジェクトを作成し、Jenkins内のJUnitレポートのxml形式でテストをエクスポートします。テストはQUnitを使用して作成されました。それはうまくいっていましたが、今では何かが変わってビルドがすべてのテストを実行しますが、決して実際には終了しません。 私のリポジトリはローカルネットワーク上のコンピュータ上にあり、私はVisualSVNを使用し、httpsにアクセスします。ここですべてのテストを実行しますが、ハングします - Jenkins

は最後のビルド(テスト出力の大部分を削除した)の出力である:私は「報道」レポーターを考え

// Karma configuration 
// Generated on Tue Oct 25 2016 13:03:04 GMT+0200 (CEST) 

module.exports = function(config) {'use strict'; 
    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: ['qunit'], 


    // list of files/patterns to load in the browser 
    files: [ 
    'js/jquery.min.js', 
    'js/phaser.min.js', 
    'Testing/unit_tests/js/qunit-parameterize.js', 
    'Testing/unit_tests/js/tests/FrnConstrMock.js', 
    'js/utils/Utility.js', 
    'js/utils/Constants.js', 
    'js/utils/InnerSlotMatrixUtility.js', 
    'js/utils/GraphicsUtility.js', 
    'js/utils/ProcessDataUtility.js', 
    'js/utils/FrnConstrErrors.js', 
    'js/utils/FrnConstrMessages.js', 
    'js/State.js', 
    'js/Screens/Boot.js', 
    'js/UI/FrnConstrButton.js', 
    'js/UI/GoToScreen.js', 
    'js/UI/GoToUrl.js', 
    'js/Screens/Screen.js', 
    'js/Screens/Preloader.js', 
    'js/Screens/EnteriorScreen.js', 
    'js/Screens/ExteriorScreen.js', 
    'js/Screens/SendApplicationScreen.js', 
    'js/Screens/TestScreen.js', 
    'js/InitFrnConstrForm.js', 
    'Testing/unit_tests/js/tests/stubs/**/*.js', 
    'Testing/unit_tests/js/tests/*.js' 
    ], 


    // list of files to exclude 
    exclude: [ 
    'Testing/unit_tests/js/tests/**/FrnConstrStub.js' 
    ], 


    // preprocess matching files before serving them to the browser 
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 
    preprocessors: { 
    //'Testing/unit_tests/js/**/*.js': ['coverage'], 
    //'js/**/*.js': ['coverage'] 
    }, 


    // test results reporter to use 
    // possible values: 'dots', 'progress' 
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter 
    reporters: ['progress', 'junit'/*, 'coverage'*/], 

    // the default configuration 
    junitReporter: { 
     outputDir: 'test-reports', // results will be saved as $outputDir/$browserName.xml 
     outputFile: 'test-results.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile 
     suite: '', // suite will become the package name attribute in xml testsuite element 
     useBrowserName: true, // add browser name to report and classes names 
     nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element 
     classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element 
     properties: {} // key value pair of properties to add to the <properties> section of the report 
    }, 


    // web server port 
    port: 9876, 


    // enable/disable colors in the output (reporters and logs) 
    colors: true, 


    // level of logging 
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 
    logLevel: config.LOG_INFO, 


    // enable/disable watching file and executing tests whenever any file changes 
    autoWatch: true, 


    // start these browsers 
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 
    browsers: [/*'Chrome', 'Firefox', */'PhantomJS'], 


    // Continuous Integration mode 
    // if true, Karma captures browsers, runs the tests and exits 
    singleRun: false, 

    // Concurrency level 
    // how many browser should be started simultaneous 
    concurrency: Infinity, 

    // client configuration 
    client: { 
     clearContext: false, 
     qunit: { 
    showUI: true, 
    testTimeout: 5000, 
    filter: '' 
     } 
    }//, 

    // optionally, configure the reporter 
    /*coverageReporter: { 
    type : 'html', 
    dir : 'coverage/' 
    }*/ 
    }); 
} 

Started by user admin 
[EnvInject] - Loading node environment variables. 
Building in workspace /var/lib/jenkins/workspace/Furniture Constructor 
Updating https://my_server_address/FurnitureConstructor/dev at revision '2016-10-27T11:01:17.530 +0200' 
U   karma.conf.js 
At revision 240 

[EnvInject] - Executing scripts and injecting environment variables after the SCM step. 
[EnvInject] - Injecting as environment variables the properties content 
$=PHANTOMJS_BIN=/usr/local/bin/phantomjs #or wherever PhantomJS happens to be installed 

[EnvInject] - Variables injected successfully. 
[Furniture Constructor] $ /bin/sh -xe /tmp/hudson7184342012546118229.sh 
+ npm install 
npm WARN package.json [email protected] No description 
npm WARN package.json [email protected] No repository field. 
npm WARN package.json [email protected] No README data 
npm WARN unmet dependency /var/lib/jenkins/workspace/Furniture Constructor/node_modules/grunt-contrib-nodeunit/node_modules/nodeunit/node_modules/tap/node_modules/nyc/node_modules/yargs/node_modules/cliui requires [email protected]'^1.0.1' but will load 
npm WARN unmet dependency undefined, 
npm WARN unmet dependency which is version undefined 
[Furniture Constructor] $ /bin/sh -xe /tmp/hudson2287766122018752412.sh 
+ karma start 
[33m27 10 2016 11:01:23.629:WARN [karma]: [39mNo captured browser, open http://localhost:9876/ 
[32m27 10 2016 11:01:23.654:INFO [karma]: [39mKarma v1.3.0 server started at http://localhost:9876/ 
[32m27 10 2016 11:01:23.655:INFO [launcher]: [39mLaunching browser PhantomJS with unlimited concurrency 
[32m27 10 2016 11:01:23.750:INFO [launcher]: [39mStarting browser PhantomJS 
[32m27 10 2016 11:01:24.400:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: [39mConnected on socket /#IAfAEFc2pEmxR12RAAAA with id 75925426 
PhantomJS 2.1.1 (Linux 0.0.0) LOG: Object{millsPerPixel: 7, millsPerPixelForDepth: 16, cupboardWidth: 2500, cupboardHeight: 2500, cupboardDepth: 700, leftShelveWidth: 250, rightShelveWidth: 250, thickness: 30, floorChkBox: true, ceilingChkBox: true, leftShelveChkBox: true, rightShelveChkBox: true, rearChkBox: true, standLeftChkBox: true, standRightChkBox: true, standChkBox: true, shelveCssColor: '#3d6990', fullWidth: 3000, maxNumOfShelves: 25, maxNumOfInnerShelves: 25, maxNumOfBeams: 25} 

PhantomJS 2.1.1 (Linux 0.0.0) LOG: Object{millsPerPixel: 7, millsPerPixelForDepth: 16, cupboardWidth: 2500, cupboardHeight: 2500, cupboardDepth: 700, leftShelveWidth: 250, rightShelveWidth: 250, thickness: 30, floorChkBox: true, ceilingChkBox: true, leftShelveChkBox: true, rightShelveChkBox: true, rearChkBox: true, standLeftChkBox: true, standRightChkBox: true, standChkBox: true, shelveCssColor: '#3d6990', fullWidth: 3000, maxNumOfShelves: 25, maxNumOfInnerShelves: 25, maxNumOfBeams: 25} 


[1A[2KPhantomJS 2.1.1 (Linux 0.0.0): Executed 0 of 1070 SUCCESS (0 secs/0 secs) 
[1A[2KLOG: 'QUnit Parametrize Plugin Meta Tests' 
PhantomJS 2.1.1 (Linux 0.0.0): Executed 0 of 1070 SUCCESS (0 secs/0 secs) 
[1A[2KPhantomJS 2.1.1 (Linux 0.0.0): Executed 1 of 1070 SUCCESS (0 secs/0.003 secs) 
[1A[2KLOG: 'QUnit Parametrize Plugin Meta Tests' 
PhantomJS 2.1.1 (Linux 0.0.0): Executed 1 of 1070 SUCCESS (0 secs/0.003 secs) 
[1A[2KPhantomJS 2.1.1 (Linux 0.0.0): Executed 1069 of 1070 (46 FAILED) (0 secs/4.852 secs) 
[1A[2KLOG: 'QUnit Parametrize Plugin Meta Tests' 
PhantomJS 2.1.1 (Linux 0.0.0): Executed 1069 of 1070 (46 FAILED) (0 secs/4.852 secs) 
[1A[2KPhantomJS 2.1.1 (Linux 0.0.0): Executed 1070 of 1070 (46 FAILED) (0 secs/4.852 secs) 
[1A[2KPhantomJS 2.1.1 (Linux 0.0.0): Executed 1070 of 1070 (46 FAILED) (5.106 secs/4.852 secs) 

私のカルマの設定ファイルは次のようになります私はそれをコメントアウトしたので、それがハングアップしていた。いいえ、それはまだ "カバレッジ"レポーターなしでもぶら下がっています。

私もスレッドダンプページを見つけました。私は理解できない情報がたくさんあります。私はそれを共有する方法を見つける必要があります、それはそれを投稿する30000文字の数を上回ります。それは役に立つだろうか?

ビルドがハングアップする理由はありますか?

答えて

1

この

singleRun: false 

はPhantomJSがハングする原因となりました。テストが終わったときにPhantomJSを停止するにはtrueに設定します。

またkarma.conf.local.jsのように、カルマのための個別の設定ファイルを作成し、コマンドを使用して、それを実行することができます。

karma start karma.conf.local.js // useful for local testing, no Jenkins 

これは、設定ファイルにのためにすべての時間を編集する必要性を防ぐことができますジェンキンス

関連する問題