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

tests don't run due to "Class 'Group' has no instance getter 'comment'." #328

Closed
skybrian opened this issue Aug 24, 2015 · 5 comments
Closed
Labels
needs-info Additional information needed from the issue author type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@skybrian
Copy link

Using 0.12.4+6, I get this error for all my tests:

$ dart test/miniml_test.dart 
Unhandled exception:
Class 'Group' has no instance getter 'comment'.

NoSuchMethodError: method not found: 'comment'
Receiver: Instance of 'Group'
Arguments: []
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2      Declarer.test (package:test/src/backend/declarer.dart:34:25)
#3      test (package:test/test.dart:117:15)
#4      main (file:///Users/skybrian/projects/miniml/dart/test/miniml_test.dart:6:3)
#5      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:261)

If I roll back to 0.12.4+5 then it works.

@nex3
Copy link
Member

nex3 commented Aug 24, 2015

Are you sure you're running 0.12.4+6? Your stack trace indicates that Group.comment is being called on line 34 of declarer.dart, but in 0.12.4+6 that line calls Group.description.

Does this happen when you run the test file via the test runner, or only directly via dart path/to/test.dart?

@nex3 nex3 added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) needs-info Additional information needed from the issue author labels Aug 24, 2015
@skybrian
Copy link
Author

I modified the pubspec and ran "pub update" to switch back and forth, and it seemed to break/fix it. I saw it using both "pub run test" and running the Dart file directly.

It's clearly not broken for everyone (and I just tried it at work and it was fine) so I'll investigate later when I'm at home.

@nex3
Copy link
Member

nex3 commented Aug 25, 2015

Make sure you run pub run test --version to figure out what version test thinks it is.

@skybrian
Copy link
Author

It looks like I somehow changed the file in .pub_cache. I moved the directory aside and downloaded it again, and everything is fine.

The only difference is:

diff -r test-0.12.4+6.old/lib/src/backend/declarer.dart test-0.12.4+6/lib/src/backend/declarer.dart
34c34
<     var prefix = _group.comment;
---
>     var prefix = _group.description;

Now that I think of it, I remember doing a search and replace from "description" to "comment" in the project I was working on, and that must have changed this file somehow. I don't see why, though, since there's no reason I would have had this file open in Atom.

I wonder if "pub" should set the permissions on files in .pub_cache to read-only to prevent this sort of thing? Anyway, it's not a test package bug.

@nex3
Copy link
Member

nex3 commented Aug 25, 2015

I wonder if "pub" should set the permissions on files in .pub_cache to read-only to prevent this sort of thing? Anyway, it's not a test package bug.

Once we get rid of package symlinks (dart-lang/pub#727), this will be much less of an issue. Until then, any permissions management is blocked on dart-lang/sdk#15078.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Additional information needed from the issue author type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants