-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fill test explorer with mutations on startup #1
Conversation
…play results in Test Explorer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik denk dat je een goede eerste opzet hebt gemaakt. Denk dat we nog wel wat beters moeten verzinnen voor het ondersteunen van verschillende platformen, aangezien 1 class met daarin alle logica van het platform mij een grote class lijkt worden. Mocht je het niet eens zijn met mijn comments laat het vooral weten.
src/platforms/platform-factory.ts
Outdated
|
||
export class PlatformFactory { | ||
|
||
public getPlatform(): Platform { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kan dit niet een static function zijn? En moeten we hier uberhaupt een class van maken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kan dit niet een static function zijn?
Ja, klopt. Ik heb het nu aangepast.
En moeten we hier uberhaupt een class van maken?
Ik verwacht dat deze factory later uitgebreid wordt met methodes om te bepalen welk Stryker-platform aangeroepen moet worden. Om die reden had ik hem al aangemaakt, maar een klasse is nu niet direct nodig. Ik kan hem eventueel weghalen als je wilt, maar het was alvast een opzet voor later.
src/platforms/strykerjs.ts
Outdated
import { ProgressLocation, window } from "vscode"; | ||
import { MutationTestResult } from "mutation-testing-report-schema"; | ||
|
||
export class StrykerJs implements Platform { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deze naam is nu wel heel generiek. Als we in de class alle functionaliteit van StrykerJS gaan zetten lijkt het mij een groot bestand te worden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik wil deze klasse enkel gebruiken voor de verschillende aanroepen van de executable, en vervolgens de resultaten daaruit afhandelen in andere klassen. Ik denk dat hij daarom niet groot zal worden. Ook kan ik nog functionaliteit afsplitsen naar de base class Platform, want ik verwacht dat het gros vergelijkbaar zal zijn tussen de Stryker-platformen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik heb nu ook het e.e.a. verplaatst naar de base abstract class
src/platforms/strykerjs.ts
Outdated
}, async () => { | ||
try { | ||
const command = `${this.executable} run --instrumentRunOnly --checkers ""` + | ||
` --buildCommand "" --plugins "" --testRunner "" --logLevel off --reporters json`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik wil voorstellen om dit net zo op te zetten als het spawen van een childprocess. Een string is lastiger te manipuleren dan een array (van argumenten).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes dat is beter! Ik heb het aangepast.
Ik gebruik nu ook spawn i.p.v. exec omdat dit een stuk sneller blijkt te zijn.
Closed vwg andere approach met mutation server, PR is niet meer relevant |
Some limitations:
It does not make use of mutation-testing-elements-schema, sadly vscode extensions do not support consuming es modules currently (Enable consuming of ES modules in extensions microsoft/vscode#130367 and Support ES6 Modules microsoft/vscode-loader#56)Edit: Fixed.Instrumenting still takes more time than needed as test runners are started, sandbox is created, ts building etc. Discussion: Instrument run only stryker-mutator/stryker-js#4799 (comment)Edit: Greatly improved performance by overwriting unnecessary time-consuming Stryker options during instrumentation run.