Raagh / angular-karma_test-explorer

vscode extension for easy angular testing and debugging
https://marketplace.visualstudio.com/items?itemName=raagh.angular-karma-test-explorer
MIT License
65 stars 23 forks source link

Duplicate test suites in multi project workspaces #28

Closed GoGoris closed 5 years ago

GoGoris commented 5 years ago

Describe the bug Test suites are duplicated as many times as there are folders opened in a multi project workspace.

To Reproduce https://github.com/GoGoris/code-karma-test-explorer-bug-duplicate-tests

  1. Open workspace duplicate-tests/duplicate-tests.workspace
  2. npm install
  3. Reopen workspace and check tests in test explorer

Logs

    at Server.setupListenHandle [as _listen2] (net.js:1330:14)
    at listenInCluster (net.js:1378:12)
    at Server.listen (net.js:1466:7)
    at listenTillKarmaReady.resolve (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\integration\karma-event-listener.js:47:25)
    at new Promise (<anonymous>)
    at KarmaEventListener.listenTillKarmaReady (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\integration\karma-event-listener.js:18:16)
    at AngularServer.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular\angular-server.js:31:43)
    at Generator.next (<anonymous>)
    at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
    at new Promise (<anonymous>)
    at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
    at AngularServer.start (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular\angular-server.js:24:24)
    at AngularKarmaTestExplorer.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular-karma-test-explorer.js:24:38)
    at Generator.next (<anonymous>)
    at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
    at new Promise (<anonymous>)
    at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
    at AngularKarmaTestExplorer.loadTests (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\core\angular-karma-test-explorer.js:16:24)
    at Adapter.<anonymous> (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\adapter.js:48:57)
    at Generator.next (<anonymous>)
    at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
    at new Promise (<anonymous>)
    at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
    at Adapter.load (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\adapter.js:42:24)
    at TestHub.registerTestAdapter (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.11.0\out\hub\testHub.js:56:17)
    at Object.registerTestAdapter (D:\Users\EBHNA\.vscode\extensions\hbenl.vscode-test-explorer-2.11.0\out\main.js:68:45)
    at TestAdapterRegistrar.add (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\vscode-test-adapter-util\out\registrar.js:45:22)
    at new TestAdapterRegistrar (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\vscode-test-adapter-util\out\registrar.js:19:22)
    at D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\main.js:28:40
    at Generator.next (<anonymous>)
    at __awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:107:75)
    at new Promise (<anonymous>)
    at Object.__awaiter (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\node_modules\tslib\tslib.js:103:16)
    at activate (D:\Users\EBHNA\.vscode\extensions\raagh.angular-karma-test-explorer-0.2.1\out\main.js:11:20)
    at Function._callActivateOptional (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:731:936)
    at Function._callActivate (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:731:625)
    at define._doActivateExtension.Promise.all.then.e (d:\Users\EBHNA\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:730:635)
workbench.main.js:238 [Extension Host] [11:20:04] INFO: Test Loading completed!

Screenshots If applicable, add screenshots to help explain your problem. afbeelding

Desktop (please complete the following information):

Additional context Plugin version: 0.2.1

Raagh commented 5 years ago

Hey Steven @GoGoris , again thank you for submitting and bug and uploading a test project where I can reproduce it. I am gonna take a look to it soon so hopefully next release fix this problems for you.

Regards, Patricio

Raagh commented 5 years ago

sorry I been really busy with the multiple instances bug that I thought it was fixed, in the end it wasn't. just tried it and seems to work fine on windows and mac. I will start with this now.

GoGoris commented 5 years ago

Sometimes I see no test suites, other times I see 2 test suites in the same project. It looks like some kind of race condition.

Raagh commented 5 years ago

I was able to reproduce it perfectly with your test project thanks :). I am working on a solution for this, will keep you posted here when I have it finished.

VaultDeveloper commented 5 years ago

I'm also interested in the support of multi-project app.

Raagh commented 5 years ago

@VaultDeveloper hi Marco, multiproject app is supported, what its still not supported is multi-root workspaces. as long as its not a workspace file and you have both projects under one root. You can open the root and use this extension(configuring the path for the angular app). Anyway, I am working on supporting multi root workspaces, it will be available soon :)

VaultDeveloper commented 5 years ago

I'm also interested in multi-root workspace.

Je travaille sur un projet monorepo qui fonctionne parfaitement, y compris les tests en ligne de commande. L'extension se lance correctement et affiche les tests du premier projet (qu'elle arrive à lancer sans problème.

Par contre, quand je change de projet, en cliquant sur le bouton en haut à gauche, l'extension charge à l'infini, et les ventilateurs de l'ordinateur accélère. J'ai testé avec 2 ordinateurs différents, même problème.

image

Pour l'instant j'ai essayé uniquement dans un workspace à une seule racine. J'ai pas le temps de faire plus d'expérimentations car l'utilisation des tests unitaires a été dé-priorisé.

Mon projet est sous Angular et Ionic.

Raagh commented 5 years ago

Hey @VaultDeveloper I will let you know when multi root workspaces are supported :). I don't speak french, please comment in English if you can. From what I understood with google translate. The first project loads fine. what kind of projects are the others? regular angular projects or ionic? Ionic is not supported( to be honest never worked with ionic before so I have no idea how is the structure).

If the other projects are not regular angular projects please could you create a feature request to support those types?(ex: Support Ionic/Angular Tests).

I am sorry to hear that testing get schedule on your project, testing should be part of the development process and it should not be prioritized, but sometimes managers don't understand that.

I am gonna close this bug and create a new feature request for multi-root workspaces to be prevent future misunderstoods.

Also if you need a support for a certain feature right away please take a look to the contributing guidelines for the project and please feel free to contribute 👍