New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
karma runner hangs indefinitely #525
Comments
+1 Windows 7 64bit Using jasmine and requirejs. I get the browser connected message in the console. If I update an auto-watched file I get a console message stating that it was changed, then a message: 'Delaying execution, these browsers are not ready: Chrome 26.0 (Windows)' |
Probably related to #411 |
@mihaihuluta @dogenpunk can you open http://localhost:9876/debug.html, pop up web inspector and see if the tests are actuallly being executed ? Any errors ? |
I am seeing this issue. I am learning, so probably making a mistake, but the code is available at https://github.com/fschwiet/letscodejavascript/ if you want to try and repro. I see the same issue on Windows 8 at OSX Mountain Lion. I am running the browser manually, but otherwise I see the same issue. I tried looking at debug.html too: it is blank when it loads, the console shows tracing that js files were loaded successfully.. The HTML source is pasted at the end of this comment. For both matchines, node version is v0.10.5. The call to 'karma run' blocks until I reload the browser, when the console then says no tests ran. server console:
client output:
Debug.html (the UI renders a blank screen):
|
@vojtajina I apologize for my late reply. In my case there were no tests run nor any errors reported on the console. |
I came across a similar issue when setting up Karma on my Windows 7 PC. My config initially looked like this - Removing the REQUIRE plugin resolved the issue for me - files = [ I think its a bug with the require plugins? |
@PocketDealHunter no, you're making the mistake I made. Your issue is that using the require adapter requires adding an additional js file. See the test-main.js file in the documentation http://karma-runner.github.io/0.8/plus/RequireJS.html |
@PocketDealHunter also, I don't think combining multiple test frameworks is a good idea. It's possible in theory, but it's not designed for it now. @fschwiet I think your Guys, is this issue resolved ? I assume it is and closing it. If you still having this issue, please re-open. Btw, if you have any ideas, how to make the require.js set easier, let me know or update the docs... |
I am experiencing this problem as well with requirejs, jasmine, and karma. I well understand the setup for test-main.js, but continue to have this problem. Karma // Karma configuration // Generated on Tue Dec 02 2014 18:27:22 GMT-0500 (Eastern Standard Time) 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: [ 'scripts/main-test.js', {pattern: 'app/test-spec.js', included: false} ], // list of files to exclude exclude: [ 'scripts/_references.js', 'scripts/jquery*intellisense.js', 'scripts/*.min.js', 'scripts/main.js' ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['junit', 'progress', 'dots'], // web server port port: 3000, // 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_DEBUG, // 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'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false, hostname: 'localhost', urlRoot: '/', plugins: ['karma-requirejs', 'karma-junit-reporter', 'karma-chrome-launcher', 'karma-jasmine'], loggers: [{ type: 'console' }] }); }; test-main.js console.log('main-test called...'); var tests = []; for (var file in window.__karma__.files) { if (window.__karma__.files.hasOwnProperty(file)) { if (/app.*\.js$/.test(file)) { console.log(file); tests.push(file); } } } console.log('calling require.config...'); require.config({ // relative url from where modules will load baseUrl: "/base/app", paths: {}, // ask Require.js to load these files (all our tests) deps: tests, // start test run, once Require.js is done callback: function () { console.log('karma starting...'); window.__karma__.start; console.log('karma started...'); } }); And the test-spec.js console.log('test-spec called...'); define([], function () { console.log('test-spec define called...'); describe('test', function () { console.log('test-spec describe called...'); it('should fail', function () { console.log('test called...'); expect(1).toEqual(2); }); }); }); Output from karma Chrome 39.0.2171 (Windows 8.1) LOG: 'main-test called...' Chrome 39.0.2171 (Windows 8.1) LOG: 'main-test called...' Chrome 39.0.2171 (Windows 8.1) LOG: '/base/app/test-spec.js' Chrome 39.0.2171 (Windows 8.1) LOG: '/base/app/test-spec.js' Chrome 39.0.2171 (Windows 8.1) LOG: 'calling require.config...' Chrome 39.0.2171 (Windows 8.1) LOG: 'calling require.config...' [2014-12-10 11:37:37.066] [DEBUG] web-server - serving (cached): E:/Projects/APA C2/APAC2/app/test-spec.js Chrome 39.0.2171 (Windows 8.1) LOG: 'test-spec called...' Chrome 39.0.2171 (Windows 8.1) LOG: 'test-spec called...' Chrome 39.0.2171 (Windows 8.1) LOG: 'test-spec describe called...' Chrome 39.0.2171 (Windows 8.1) LOG: 'test-spec describe called...' Chrome 39.0.2171 (Windows 8.1) LOG: 'test-spec define called...' Chrome 39.0.2171 (Windows 8.1) LOG: 'test-spec define called...' Chrome 39.0.2171 (Windows 8.1) LOG: 'test-spec describe called...' Chrome 39.0.2171 (Windows 8.1) LOG: 'test-spec describe called...' Chrome 39.0.2171 (Windows 8.1) LOG: 'karma starting...' Chrome 39.0.2171 (Windows 8.1) LOG: 'karma starting...' Chrome 39.0.2171 (Windows 8.1) LOG: 'karma started...' Chrome 39.0.2171 (Windows 8.1) LOG: 'karma started...' [2014-12-10 11:37:47.064] [WARN] Chrome 39.0.2171 (Windows 8.1) - Disconnected ( 1 times), because no message in 10000 ms. Chrome 39.0.2171 (Windows 8.1): Executed 0 of 0 DISCONNECTED (10.13 secs / 0 sec s) [2014-12-10 11:37:47.069] [DEBUG] reporter.junit - JUnit results written to "E:/ Projects/APAC2/APAC2/test-results.xml". Note that from test-spec.js, define gets called, and describe gets called, but it never does. The behaviour is exactly as described above and karma just hangs and disconnects, no tests get called. |
Wow. I ashamedly resolved my problem. face palm. I simply wasn't invoking the window.karma.start() method.... So yeah, must've been in a hurry and had copied code from somewhere and then wrapped the function and forgot to add the (). Sigh. Back to it... |
Environment
Windows 8 64bit
Node.js 0.10.5 64bit
Karma 0.8.5
I am able to start karma server, Chrome browser opens (I have it defined as default browser in karma config). The issue comes when I am doing 'karma run'. Chrome changes the tab status to Chrome 26.0 (Windows) is executing. But that is all, no output on the console, no nothing. it can stay like that for hours.
Any ideas?
The text was updated successfully, but these errors were encountered: