-
-
Notifications
You must be signed in to change notification settings - Fork 23
Test reloader spins indefinitely #17
Comments
Hi @AlexanderLea , are you using Angular or just Karma? if its angular could you provide me with a test project to reproduce the bug?. the test loader currently does not supports standalone karma, only karma inside of Angular. It will be supported very soon though, as it doesn't require too much work to happen. PS: the test explorer is called Angular/Karma cause its difficult to change the name after published. And also its gonna happen very soon ahha. It is already in the planned features mentioned in the README.md :) |
Using within Angular 7. Might well be test volume - we have nearly 2800 tests. Works fine on a ng new empty Angular project. Will work on a repro :) |
@AlexanderLea might be, to be honest I only have around 1500. could you also open developer tools and check if there is an error or log in there? Thanks a lot for your feedback! |
Ah - I've got a stack trace and error in the console. I can't see anything related specifically to my code in here. @Raagh are you able to pass your eyes over it? No worries for the feedback - thanks for writing the extension! We are super excited to be able to use it :) [Extension Host] Starting Angular tests with arguments: test --karma-config="C:\Users\alexander.lea.vscode\extensions\raagh.angular-karma-test-explorer-1.0.0\out\config\test-explorer-karma.conf.js" ERR listen EADDRINUSE :::1111: Error: listen EADDRINUSE :::1111 ERR spawn ng ENOENT: Error: spawn ng ENOENT |
Seems to me that you already have a server running on port 1111 (or something using that port). I use this port for a socket connection between the custom karma reporter and the test explorer. In order to show the results of the tests in the UI. could you check if this is the case? I will definitely make that value configurable. If you also wanna make sure that's the issue please feel free to clone the repo following this steps and change port here
and here
I will try to reproduce it tonight when I get home myself |
Cool - I'll give it a go. I set up a new project earlier, and I didn't get any errors running on the same machine - surely that would've also failed on the port issue? A. |
yes unless that port is being used by the angular application itself (or a backend for that angular app), but I guess you would have noticed that. its weird that node complains exactly about that "ERR listen EADDRINUSE :::1111: Error: listen EADDRINUSE :::1111" |
Checked out the project, and ran in debug (the new port didn't make a difference - still fails). Got a different error - does this one shed any light? stack trace: SyntaxError: Unexpected token in JSON at position 0 |
Not really, though now the error is indeed further in the code, before the extension was unable to create a socket on port 1111. now the server successfully started listening on port 65535 as the log says : "Listening to AngularReporter events on port 65535" could you upload a test project for me so I can debug it and see where the error comes from? do you have path.intellisense extension installed right? cause the error seems to be triggered there. https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense SyntaxError: Unexpected token in JSON at position 0 could you try uninstalling that extension and running everything again? |
Uninstalled and get the same extension error - less peripheral errors tho. Here's the stack here. Maybe I'll try deleting all extensions (or a fresh install somewhere) and then give it a go. Here's a stack with fewer other errors 2019-03-26T16:29:54.530Z - debug: [TypescriptHero] Setting up extension and activatables. |
Indeed it might be good to try that same project( with the installed extension) on another computer or fresh install to rule out any outside interference. If you can prepare that test project for me I will be happy to help :) |
Any more information on this? |
Closed due to lack of information |
Hi, Sorry for lack of contact - holiday/busy etc. I've got a fresh install with no extensions, and getting different errors with the latest code from git: Starting Angular tests with arguments: test --karma-config="c:\Users\alexander.lea\Documents\GitHub\angular-karma_test-explorer\out\config\test-explorer-karma.conf.js" --progress=false Listening to AngularReporter events on port 9999 error from ng child process: Error: spawn ng ENOENT Any suggestions? I'm gonna struggle to do a real test project (corporate rules etc), but will give it a go tonight. Alex |
No worries! okey lets start: Some things I learned about the project while you were gone. So please make sure your project is not one of this types. all this types of projects are being addressed in this branch: https://github.com/Raagh/angular-karma_test-explorer/tree/feature/support-multiple-apps but it still not ready. If this is not your case then keep reading so we figure out whats going on. please make sure you have the last master downloaded without any changes. also make sure you did npm install in your project and that doing ng test successfully runs tests inside your project. after that if you have this 2 lines not commented:
you should get errors from the spawn process. the error you got is basically telling you that something failed when launching ng test. with those 2 two lines not commented you should see more errors related to the problem. open developer tools inside vscode to check every error you get related to this :) |
Hey, So if I run ng test I get the fairly standard "JavaScript heap out of memory" error (angular/angular-cli#5613). If I run Debugging with that line uncommented, I get the following error, which looks like it doesn't like my karma.conf.js?
|
okey, So i am guessing that after fixing the karma error will still not work cause there is something already wrong with your enviroment, ng test should work on your project for this to work. I like the idea of adding a config value for extra parameters though. I will try to implement it in future updates. But lets try to fix the karma issue first, is actually your karma.conf there? for a regular angular-cli project the karma.conf.js should be inside the src folder, so what the current version of my code does is first it looks it inside: c:\Users\alexander.lea\Documents\Git\NextGen\InveniasWebApp\src\karma.conf.js if its not there it will look it up in the root c:\Users\alexander.lea\Documents\Git\NextGen\InveniasWebApp\karma.conf.js. if its not there it will fail. which is your case, so where exactly is your karma.conf? the test explorer is basically not finding your karma.conf in the 2 default positions for an angular-cli project. |
Hi, I feel stupid - karma.conf.js was buried in a /configs directory. I've moved back to the route and now I'm getting the out of memory exception from If I change ln 55 of angular-server.ts to be: ... then it works (angular runs out of memory generating the sourcemaps). |
Awesome!, we dont really need the source maps so I will make sure to include that code with next update. Also about the config don't worry, the multi-apps branch I showed you will read the path of the karma.conf from the angular.json so hopefully for next version your scenario will be fully supported :). I will comment here to let you know when that happens |
Thanks so much for your help and patience :) |
No worries, thank you for downloading the extension and take the time with bug |
Hi,
Trying to load my karma tests, the loading indicator is spinning indefinitely.
Are there logs I can access somewhere, or something I can do to work out what it's doing?
Alex
The text was updated successfully, but these errors were encountered: