Skip to content
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

Corriger les tests karma (javascript) #45

Open
vincentdoba opened this issue Dec 14, 2014 · 1 comment
Open

Corriger les tests karma (javascript) #45

vincentdoba opened this issue Dec 14, 2014 · 1 comment
Labels

Comments

@vincentdoba
Copy link

Actuellement lorsqu'on lance les tests karma, on se retrouve avec la stack suivante :

Error: [$injector:modulerr] http://errors.angularjs.org/1.2.27/$injector/modulerr?p0=fac-stemi&p1=Error: [$injector:modulerr] http://errors.angularjs.org/1.2.27/$injector/modulerr?p0=ngResource&p1=Error: [$injector:nomod] http://errors.angularjs.org/1.2.27/$injector/nomod?p0=ngResource
    at http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular.min.js?3c25c93f52b69d7b7bcf6f1055353cda1ff081a0:21
    at http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular.min.js?3c25c93f52b69d7b7bcf6f1055353cda1ff081a0:21
    at http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular.min.js?3c25c93f52b69d7b7bcf6f1055353cda1ff081a0:33
    at r (http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular.min.js?3c25c93f52b69d7b7bcf6f1055353cda1ff081a0:7)
    at e (http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular.min.js?3c25c93f52b69d7b7bcf6f1055353cda1ff081a0:34)
    at http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular.min.js?3c25c93f52b69d7b7bcf6f1055353cda1ff081a0:33
    at r (http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular.min.js?3c25c93f52b69d7b7bcf6f1055353cda1ff081a0:7)
    at e (http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular.min.js?3c25c93f52b69d7b7bcf6f1055353cda1ff081a0:34)
    at ec (http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular.min.js?3c25c93f52b69d7b7bcf6f1055353cda1ff081a0:36)
    at workFn (http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular-mocks.js?341e88b947784ad0944e05fb968378088b46efba:2172)
    at http://localhost:8082/absolute/home/vincent/Projets/Travail/Lateral-Thoughts/systemi/target/web/public/test/public/lib/angularjs/angular-mocks.js?341e88b947784ad0944e05fb968378088b46efba:2163
    at http://localhost:8082/base/unit-test/invoice.js?0114627bd714eab488813db335823b45552885d7:22
    ...
    at http://localhost:8082/base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?aa6ac7a9fb8b473d3e2ca231cd383b00a811ec49:569
    at http://localhost:8082/base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?aa6ac7a9fb8b473d3e2ca231cd383b00a811ec49:606
    at http://localhost:8082/base/node_modules/karma-jasmine/lib/boot.js?925440973c97e93b99c71f4b1091e4ef4a713597:126
    at http://localhost:8082/base/node_modules/karma-jasmine/lib/adapter.js?f5bb63f803b8f4d472730641a2929add290ec98e:184
    at http://localhost:8082/karma.js:185
    at http://localhost:8082/context.html:107

Cette erreur apparait car angular n'arrive pas à charger un module. Les points à résoudre sont donc :

  • Quel module il n'arrive pas à charger
  • Comment charger ledit module
@vincentdoba
Copy link
Author

Les tests karma passent en locale mais pas sur notre intégration continue (jenkins). Les tests foirent avec l'erreur suivante :

+ /var/lib/jenkins/workspace/Systemi/../../tools/node_modules/karma/bin/karma start test/angular-test/karma.conf.js
�[32mINFO [karma]: �[39mKarma v0.12.1 server started at http://localhost:8082/
�[32mINFO [launcher]: �[39mStarting browser PhantomJS
�[32mINFO [PhantomJS 1.9.7 (Linux)]: �[39mConnected on socket Q8UcXkh6nbJoGcsap8ML with id 74653109
..........�[33mWARN [web-server]: �[39m404: /activity

�[31mPhantomJS 1.9.7 (Linux) ERROR�[39m
  Some of your tests did a full page reload!
PhantomJS 1.9.7 (Linux): Executed 10 of 10�[31m ERROR�[39m (0.059 secs / 0.048 secs)
PhantomJS 1.9.7 (Linux): Executed 10 of 10�[31m ERROR�[39m (0.061 secs / 0.048 secs)
�[31mERROR [karma]: �[39m[TypeError: Cannot read property '74653109' of null]
TypeError: Cannot read property '74653109' of null
    at onBrowserComplete (/var/lib/jenkins/tools/node_modules/karma-junit-reporter/index.js:47:23)
    at null.<anonymous> (/var/lib/jenkins/tools/node_modules/karma/lib/events.js:15:22)
    at EventEmitter.emit (events.js:117:20)
    at onComplete (/var/lib/jenkins/tools/node_modules/karma/lib/browser.js:145:13)
    at Socket.<anonymous> (/var/lib/jenkins/tools/node_modules/karma/lib/events.js:15:22)
    at Socket.EventEmitter.emit [as $emit] (events.js:117:20)
    at SocketNamespace.handlePacket (/var/lib/jenkins/tools/node_modules/karma/node_modules/socket.io/lib/namespace.js:335:22)
    at Manager.onClientMessage (/var/lib/jenkins/tools/node_modules/karma/node_modules/socket.io/lib/manager.js:488:38)
    at WebSocket.Transport.onMessage (/var/lib/jenkins/tools/node_modules/karma/node_modules/socket.io/lib/transport.js:387:20)
    at Parser.<anonymous> (/var/lib/jenkins/tools/node_modules/karma/node_modules/socket.io/lib/transports/websocket/default.js:36:10)
Build step 'Exécuter un script shell' marked build as failure
Xvfb stopping
Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
Finished: FAILURE

Je ne comprends pas très bien pourquoi... Peut-être la version de karma. En local j'utilise la 0.12.28, sur le serveur ça a l'air d'être la 0.12.1

@vincentdoba vincentdoba reopened this Jan 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant