Skip to content

Conversation

@jaspervdveen
Copy link
Member

@jaspervdveen jaspervdveen commented Oct 10, 2025

Resolves #58

  • Use stdio as transport mode
  • Improved test coverage
  • No longer open output channel on error

BREAKING CHANGE: drop support for socket transport with mutation server

@jaspervdveen jaspervdveen changed the title feat(plugin): support dual transport mode feat(plugin): use stdio instead of tcp socket for transport Oct 24, 2025
Copy link
Member

@nicojs nicojs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This simplifies the code a lot! I've got some remarks and a question.

*/
private log(level: string, message: string, ...labels: string[]): void {
// Strip trailing newlines from the message
const cleanedMessage = message.replace(/\n+$/, '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would we remove newlines? Let's make the logging output recognizable to the end user (like what they already recognize in the 'normal' output).

/**
* Abstract interface for mutation server transport implementations
*/
export interface ITransport {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is considered a bad practice to prefix interfaces with an I in TypeScript, as there is no technical need to do so (in C#, there is, because there is no visual distinction when extending interfaces vs classes).

But this interface isn't even needed, since it is the same as StdioTransport.

};
write(data: string | Buffer) {
if (!this.#process?.stdin) {
throw new Error('Process stdin is not available');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unreachable code, since we're not overriding the stdio options. stdin should always exist, or Node.js isn't working correctly. I would be happy using a ! here.

onPartialResult: (partialResult: MutationTestResult) => void,
): Promise<MutationTestResult> {
const subscription = this.notifications
const subscription = this.transport.notifications
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we're subscribing to the notifications whenever we start a new run. What happens when the user begins multiple runs? Won't the notifications interfere with each other?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch transport layer protocol to stdio

3 participants