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

feat(Command test runner): Add command test runner #1047

Merged
merged 9 commits into from
Aug 17, 2018

Conversation

nicojs
Copy link
Member

@nicojs nicojs commented Jul 27, 2018

Add the command test runner. This test runner simply runs command from the bash/cmd prompt. It defaults to npm test.

It will always report exactly one test result (called 'All tests'), as it cannot distinguish between the tests. It is implemented differently from other test runners, as we don't want to spawn this one in a separate process (it already uses require('child_process').exec to start a test run).

Fixes #768

Add the command test runner. This test runner simply
runs command from the bash/cmd prompt.
It defaults to `npm test`
@ghost ghost assigned nicojs Jul 27, 2018
@ghost ghost added the 🔎 Needs review label Jul 27, 2018
@simondel
Copy link
Member

What are your thoughts on the integration with stryker init and the use of a test framework in your config?

@nicojs
Copy link
Member Author

nicojs commented Jul 27, 2018

For stryker init, I was thinking to put it as a last option:

  • Use npm test (or other command)

How would we communicate that this option is much slower?

Configuring a test framework doesn't make sense anymore. The test runner does not support test selection. Good point, I will implement a fail fast for this.

@nicojs
Copy link
Member Author

nicojs commented Jul 27, 2018

I've altered the first question to look like this:

image

This should be clear enough. If you select "command", the test framework question is skipped.

I've created #1049 for preset support. Let's not do that in this PR.

@nicojs nicojs mentioned this pull request Jul 28, 2018
Implement timeout functionality by implementing the `dispose` call.
This kills the child process and resolves the promise as a timeout (to prevent a memory leak)
@nicojs
Copy link
Member Author

nicojs commented Jul 30, 2018

I just totally forgot about the timeout functionality. Implemented now.

Copy link

@DiegoRBaquero DiegoRBaquero left a comment

Choose a reason for hiding this comment

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

Finally got to review this! Looks great! Did you have any issues with zombie sub sub processes?

@simondel
Copy link
Member

Do you have an open source project where you had these issues? Because then we could try it out :) we are pretty thorough with killing processes.

@DiegoRBaquero
Copy link

I don't quite remember which one it was exactly, but for sure it's in the top 20 most depended upon npm modules and I think it ran karma. I can't really remember which one it was. I should have documented it, sorry :(

@simondel
Copy link
Member

No problem :)

@ghost ghost assigned simondel Aug 17, 2018
@simondel
Copy link
Member

This code is really clean. Nice job @nicojs! 💖

@simondel simondel merged commit ee919fb into master Aug 17, 2018
@ghost ghost removed the 🔎 Needs review label Aug 17, 2018
@simondel simondel deleted the feat/command-test-runner branch August 17, 2018 10:49
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.

3 participants