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

Visual Studio wallaby start problem #283

Closed
brettjacobson opened this issue Oct 3, 2015 · 3 comments
Closed

Visual Studio wallaby start problem #283

brettjacobson opened this issue Oct 3, 2015 · 3 comments

Comments

@brettjacobson
Copy link

WallabyJS is no longer working for me, with an exception that offers little guidance as to where the problem is.
When I try and start wallabyJS (by right clicking the wallaby.json file), I'm now getting the following text in the console log:

wallaby.js started
core v1.0.123
wallaby.js stopped

The .wallaby/*.log file contains the following exception detail:

2015-10-03 17:23:41Z [46] Error Wallaby.Runner 0: Failed to start Runner.
System.AggregateException: One or more errors occurred. ---> System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   --- End of inner exception stack trace ---
   at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at ‬‬‮‌‮‬‬‪‮‪‍‪‌‬‍‫‍‎‍‮.‌‎‏‬‪​‎‏‬‌‏‏‫‭‮‎‭‮‫‌‬‬‪‫‬‫‮.‍‍‫‮‭​‍‏‪‪‌‬‌‮‏‮‫‬‪‏‬‍‭‮()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at ‬‬‮‌‮‬‬‪‮‪‍‪‌‬‍‫‍‎‍‮.\]CMH|ML"~qtBYAz^t%|#OJGc.MoveNext()
---> (Inner Exception #0) System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.ParallelEnumerable.ToDictionary[TSource,TKey,TElement](ParallelQuery`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)<---

So two things that may have affected this (since it used to work); but my memory is fuzzy if I tried wallaby after the changes. One thing was that I upgraded to v1.0.16 from v1.0.15. The other thing that I did in a similar time frame was changing my "testFramework" tag from jasmine@2.2.1 to just plain "jasmine". I've tried going back to @2.2.1 with no luck.

Last, here is my wallaby.json file:

{
  "files": [
    "Scripts/sinon-1.9.1.js",
    "Scripts/angular.js",
    "Scripts/angular-ui-router.js",
    "Scripts/angular-mocks.js",
    "Scripts/angular-sanitize.js",
    "Scripts/select.js",
    "Scripts/ngDialog.js",
    "Scripts/tree-grid-directive.js",
    "Scripts/ui-grid.js",

    "JSTests/lib/specHelper.js",
    "JSTests/**/mock*.js",

    "app/**/*.module.js",
    "app/**/*.js"
  ],
  "tests": [
    "JSTests/**/*.spec.js",
    "JSTests/**/*Tests.js",
    "JSTests/**/*Test.js"
  ],
  "testFramework": "jasmine"
}

I also added "debug": true to the json file, but saw nothing extra in the console or the .log file.

@ArtemGovorov
Copy link
Member

Thanks for providing the log, was very helpful. We are still not able to reproduce the issue locally, but according to the stack it looks like it may be related to some files that you may have added to your solution recently. More specifically, VS extension API reports the exact same file path more than once, and we were not expecting it in our code. Perhaps some file was added as link (and more than once?), not sure if/how it's possible. We are going to fix it shortly anyway so no matter how it happened, wallaby will be ok with it.

Another (non related to the issue) thing I have noticed is that your libraries are instrumented (like all files in the files list by default). I'd recommend setting instrument: false flag for those files, that'll make your tests run faster because wallaby will not have to track code coverage for them.

@ArtemGovorov
Copy link
Member

The issue should be fixed in 1.0.17. Please try the latest version (should prompt to update automatically) and let me know if the issue has gone.

@brettjacobson
Copy link
Author

Yep, fixed it! After upgrading to .17, I also found what was probably triggering the bug.

Due to a merge conflict, one particular .js file was included in the .csproj file twice, so I suspect that is what was triggering the exception.

Thank you for fixing my screwup! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants