dart-archive / angular.dart

Legacy source repository. See github.com/dart-lang/angular
https://webdev.dartlang.org/angular/
1.25k stars 248 forks source link

Can't get tests working on Linux #584

Closed zoechi closed 10 years ago

zoechi commented 10 years ago

Dart VM version: 1.2.0-dev.5.10 (Wed Feb 19 01:25:31 2014) on "linux_x64" I have set up my environment like explained here https://github.com/angular/angular.dart/blob/master/DEVELOPER.md

./run-test.sh

└── socket.io@0.9.16 (base64id@0.1.0, policyfile@0.0.4, redis@0.7.3, socket.io-client@0.9.16)
Dart VM version: 1.2.0-dev.5.10 (Wed Feb 19 01:25:31 2014) on "linux_x64"
Unable to open file: /home/zoechi/source/my/dart/angular.dart/test/io/packages/di/generator.dart'package:angular/tools/template_cache_generator.dart': error: line 10 pos 1: library handler failed
import 'package:di/generator.dart';
^
'file:///home/zoechi/source/my/dart/angular.dart/test/io/template_cache_generator_spec.dart': error: line 6 pos 1: library handler failed
import 'package:angular/tools/template_cache_generator.dart' as generator;
^
'file:///home/zoechi/source/my/dart/angular.dart/test/io/all.dart': error: line 5 pos 1: library handler failed
import 'template_cache_generator_spec.dart' as template_cache_generator_spec;
^

run Karma tests

 (master) $ . ./scripts/env.sh 
zoechi@znote_linux ~/source/my/dart/angular.dart
 (master) $ node "node_modules/karma/bin/karma" start karma.conf --reporters=junit,dots --port=8765 --runner-port=8766 --browser=Dartium
INFO [karma]: Karma v0.10.9 server started at http://localhost:8765/
INFO [generate-parser]: Generating parser for parser test: /home/zoechi/source/my/dart/angular.dart/test/core/parser/generated_functions.dart
INFO [generate-parser]: Generating parser for parser test: /home/zoechi/source/my/dart/angular.dart/test/core/parser/generated_getter_setter.dart
ERROR [karma]: { [Error: Command failed: Unhandled exception:
Class '_LocalLibraryMirror' has no instance getter 'classes'.

NoSuchMethodError : method not found: 'classes'
Receiver: Instance of '_LocalLibraryMirror'
Arguments: []
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#1      getClassMirrorBySymbol (package:di/mirrors.dart:28:35)
#2      _TypeProvider._TypeProvider (package:di/dynamic_injector.dart:276:50)
#3      _ProviderMetadata._ProviderMetadata.forType (package:di/dynamic_injector.dart:324:20)
#4      _registerBinding (package:di/dynamic_injector.dart:47:31)
#5      _HashMap.forEach (dart:collection-patch/collection_patch.dart:146)
#6      DynamicInjector.DynamicInjector._fromParent.<anonymous closure> (package:di/dynamic_injector.dart:36:30)
#7      List.forEach (dart:core-patch/growable_array.dart:240)
#8      DynamicInjector.DynamicInjector._fromParent (package:di/dynamic_injector.dart:35:20)
#9      DynamicInjector.DynamicInjector (package:di/dynamic_injector.dart:27:9)
#10     main (file:///home/zoechi/source/my/dart/angular.dart/bin/parser_generator_for_spec.dart:18:27)
#11     _startIsolate.isolateStartHandler (dart:isolate-patch/isolate_patch.dart:214)
#12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:115)
]
  stack: 'Error: Command failed: Unhandled exception:\nClass \'_LocalLibraryMirror\' has no instance getter \'classes\'.\n\nNoSuchMethodError : method not found: \'classes\'\nReceiver: Instance of \'_LocalLibraryMirror\'\nArguments: []\n#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)\n#1      getClassMirrorBySymbol (package:di/mirrors.dart:28:35)\n#2      _TypeProvider._TypeProvider (package:di/dynamic_injector.dart:276:50)\n#3      _ProviderMetadata._ProviderMetadata.forType (package:di/dynamic_injector.dart:324:20)\n#4      _registerBinding (package:di/dynamic_injector.dart:47:31)\n#5      _HashMap.forEach (dart:collection-patch/collection_patch.dart:146)\n#6      DynamicInjector.DynamicInjector._fromParent.<anonymous closure> (package:di/dynamic_injector.dart:36:30)\n#7      List.forEach (dart:core-patch/growable_array.dart:240)\n#8      DynamicInjector.DynamicInjector._fromParent (package:di/dynamic_injector.dart:35:20)\n#9      DynamicInjector.DynamicInjector (package:di/dynamic_injector.dart:27:9)\n#10     main (file:///home/zoechi/source/my/dart/angular.dart/bin/parser_generator_for_spec.dart:18:27)\n#11     _startIsolate.isolateStartHandler (dart:isolate-patch/isolate_patch.dart:214)\n#12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:115)\n\n    at ChildProcess.exithandler (child_process.js:579:15)\n    at ChildProcess.EventEmitter.emit (events.js:97:17)\n    at maybeClose (child_process.js:677:16)\n    at Process.ChildProcess._handle.onexit (child_process.js:744:5)\n    at process._makeCallback (node.js:321:24)',
  killed: false,
  code: 255,
  signal: null }
Error: Command failed: Unhandled exception:
Class '_LocalLibraryMirror' has no instance getter 'classes'.

NoSuchMethodError : method not found: 'classes'
Receiver: Instance of '_LocalLibraryMirror'
Arguments: []
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#1      getClassMirrorBySymbol (package:di/mirrors.dart:28:35)
#2      _TypeProvider._TypeProvider (package:di/dynamic_injector.dart:276:50)
#3      _ProviderMetadata._ProviderMetadata.forType (package:di/dynamic_injector.dart:324:20)
#4      _registerBinding (package:di/dynamic_injector.dart:47:31)
#5      _HashMap.forEach (dart:collection-patch/collection_patch.dart:146)
#6      DynamicInjector.DynamicInjector._fromParent.<anonymous closure> (package:di/dynamic_injector.dart:36:30)
#7      List.forEach (dart:core-patch/growable_array.dart:240)
#8      DynamicInjector.DynamicInjector._fromParent (package:di/dynamic_injector.dart:35:20)
#9      DynamicInjector.DynamicInjector (package:di/dynamic_injector.dart:27:9)
#10     main (file:///home/zoechi/source/my/dart/angular.dart/bin/parser_generator_for_spec.dart:18:27)
#11     _startIsolate.isolateStartHandler (dart:isolate-patch/isolate_patch.dart:214)
#12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:115)

    at ChildProcess.exithandler (child_process.js:579:15)
    at ChildProcess.EventEmitter.emit (events.js:97:17)
    at maybeClose (child_process.js:677:16)
    at Process.ChildProcess._handle.onexit (child_process.js:744:5)
    at process._makeCallback (node.js:321:24)
zoechi@znote_linux ~/source/my/dart/angular.dart
 (master) $

annoyingly when the script ends, it closes the bash session where it was started from

What could be wrong?

bgourlie commented 10 years ago

I ran into this to. Increasing the minimum version constraint on the di package to 0.0.34 in the pubspec.yaml should fix it. The location of the generator file has moved apparently.

bgourlie commented 10 years ago

Double checked and the version for di actually needs to be 0.0.32.

zoechi commented 10 years ago

Great! That solved it. Thanks for your fast response. There is already a pull request https://github.com/angular/angular.dart/pull/583

zoechi commented 10 years ago

Do you also have the issue with the test scripts that they are closing the shell? karma_run.sh does this as well.

zoechi@znote_linux ~/source/my/dart/angular.dart
 (master) $ ./karma_run.sh
Analyzing lib/angular.dart...
[hint] Unused import (/home/zoechi/source/my/dart/angular.dart/lib/core_dom/module.dart, line 13, col 8)
[hint] Unused import (/home/zoechi/source/my/dart/angular.dart/lib/core_dom/module.dart, line 13, col 8)
[info] The selector 'r':contains(/{{.*}}/)'' cannot be parsed (/home/zoechi/source/my/dart/angular.dart/lib/core_dom/ng_mustache.dart, line 3, col 24)
[info] The selector ''.ng-cloak'' cannot be parsed (/home/zoechi/source/my/dart/angular.dart/lib/directive/ng_cloak.dart, line 26, col 24)
[info] The selector ''.ng-form'' cannot be parsed (/home/zoechi/source/my/dart/angular.dart/lib/directive/ng_form.dart, line 17, col 15)
[hint] 'RouteInitializer' is deprecated (/home/zoechi/source/my/dart/angular.dart/lib/routing/module.dart, line 26, col 35)
[hint] 'RouteInitializer' is deprecated (/home/zoechi/source/my/dart/angular.dart/lib/routing/module.dart, line 26, col 35)
[hint] 'RouteInitializer' is deprecated (/home/zoechi/source/my/dart/angular.dart/lib/routing/module.dart, line 177, col 11)
[hint] 'RouteInitializer' is deprecated (/home/zoechi/source/my/dart/angular.dart/lib/routing/module.dart, line 177, col 11)
9 hints found.
[2014-02-19 18:28:24.348] [DEBUG] config - Loading config /home/zoechi/source/my/dart/angular.dart/karma.conf.js
No captured browser, open http://localhost:8765/
zoechi@znote_linux ~/source/my/dart/angular.dart
 (master) $

karma_run.sh produces above output and then stops and again closes the current shell.

bgourlie commented 10 years ago

Do you any aliases defined for any commands? For example, I had an alias for ls that added some additional switches and it was causing the shell to close when running the tests.

zoechi commented 10 years ago

alias la='ls -lahFLH --color --group-directories-first' My only alias. I don't think this can do any harm.

chalin commented 10 years ago

Originally, I had AngularDart scripts closing my shells in Emacs only. Now they are closing shells outside of Emacs too. For Emacs related issues I found this: Issue 14301: Running a dart program in the emacs shell in macos kills the emacs shell process.

mhevery commented 10 years ago

Is this still an issue or can it be closed?

zoechi commented 10 years ago

I just tried it. This issue seems to be gone.

I have another one but I will create a new issue for it.