-
Notifications
You must be signed in to change notification settings - Fork 250
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
perf: reduce next stryker runs #1610
Comments
After small rethinking, options would be if(enableGitOptimisation !== false) {
let filesFromGit;
if(enableGitOptimisation === true) {
filesFromGit = child_process.execSync('git', ['diff', 'HEAD', '--name-only']).stdout.toString().split('\n').map(el => el.trim());
} else {
filesFromGit = child_process.execSync('git', ['diff', enableGitOptimisation, '--name-only']).stdout.toString().split('\n').map(el => el.trim());
}
return getAllFiles(files).map((file) => filesFromGit.indexOf(file) > -1);
} else {
return getAllFiles(files);
} (pseudocode to ilustrate it more or less) |
What about merging the results? |
@Djaler merging the results? |
I mean reports |
I don't quite understand @Djaler what you mean :/ |
I mean that by running stryker only for changed files you will get report only for this files. But we need to see the whole picture |
@Djaler So we have two options...
But you have a point I think the second option is a better one since, for example, user can by hand using |
I think this is related to #322 |
It is slightly, yea. I think we should finish #1514 for now and maybe try this, at least using point '2' so we have an experimental version of this feature, and then we can try changing '2' into '1' :) |
Great discussion here ❤️ The problem with only running Stryker on changed files can not always be trusted. Let's say you only change test files in a PR. There is no way to verify exactly which mutatations should be retested. So it would only works for changes made to source files to be mutated. I think it's pretty easy to add a small part of code to your stryker.conf.js file to do this. Or use the stryker-diff-runner by @tverhoken that does exactly this.
I think this is the easy part. In fact, we've created the mutation-testing-report-schema with exactly this goal in mind. It's basically merging the |
I have been lurking through issues and files, and I have found, that we could improve stryker performance, by checking, which files have been updated since the last commit.
The easiest way would be:
git diff HEAD^ HEAD --name-only
we could use this command in JS simply with exec or spawn:
const child = require('child_process');
child.spawnSync('git', ['diff', 'HEAD^', 'HEAD' ,'--name-only']).stdout.toString()
git diff HEAD^ --name-only
with staged changegit diff HEAD^ HEAD --name-only
with staged changegit diff HEAD^ --name-only
without staged changeI guess it can be customizable for user, for example, to choose between
git diff HEAD^ HEAD --name-only
andgit diff HEAD^ --name-only
or to switch it off.The text was updated successfully, but these errors were encountered: