-
Notifications
You must be signed in to change notification settings - Fork 241
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(ignore patterns): add "ignorePatterns" config option #2848
Changes from all commits
9ac5e0b
83baa65
18a6a64
dc9f09d
8b5d8b3
6f778ef
90f46e4
eb0fcd3
043716f
1c70a30
28510b0
6fc7b2b
f518b66
9ec65f5
83d86e6
d6ee659
5b0c896
aba6897
a557501
3f1138a
02d1171
644f743
4fac565
fe5eacd
2e59d55
eb135fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "../../node_modules/@stryker-mutator/core/schema/stryker-schema.json", | ||
"mutate": [ | ||
"sampleProject/src/**" | ||
], | ||
"karma": { | ||
"config": { | ||
"files": [ | ||
"sampleProject/**" | ||
] | ||
} | ||
}, | ||
"testRunner": "karma", | ||
"logLevel": "info", | ||
"fileLogLevel": "warn", | ||
"concurrency": 2 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { expect } from 'chai'; | ||
import fs from 'fs'; | ||
|
||
describe('grunt stryker test', () => { | ||
it('should not log warnings', () => { | ||
const logFileContents = fs.readFileSync('stryker.log', 'utf-8'); | ||
expect(logFileContents).empty; | ||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -253,7 +253,7 @@ | |
"type": "number" | ||
}, | ||
"maxTestRunnerReuse": { | ||
"description": "Restart each forked threads after <n> runs. Not recommended unless you are experiencing memory leaks that you are unable to resolve. (default: 0)", | ||
"description": "Restart each forked worker after <n> runs. Not recommended unless you are experiencing memory leaks that you are unable to resolve. (default: 0)", | ||
"type": "number", | ||
"default": 0 | ||
}, | ||
|
@@ -282,18 +282,19 @@ | |
"$ref": "#/definitions/eventRecorderOptions", | ||
"default": {} | ||
}, | ||
"ignorePatterns": { | ||
"description": "Specify the patterns to all files or directories that are not used to run your tests and thus should *not be copied* to the sandbox directory for mutation testing. Each patterns in this array should be a [`.gitignore`-style glob pattern](https://git-scm.com/docs/gitignore#_pattern_format).\n\nThese patterns are **always ignored**: `['node_modules', '.git', '/reports', '/stryker.log', '.stryker-tmp']`. Because Stryker always ignores these, you should rarely have to adjust the `\"ignorePatterns\"` setting at all. If you want to undo one of these ignore patterns, you can use the `!` prefix, for example: `['!node_modules']`.\n\nIf a glob pattern starts with `/`, the pattern is relative to the current working directory. For example, `/foo.js` matches to `foo.js` but not `subdir/foo.js`.\n\nWhen using the command line, the list can only contain a comma separated list of globbing expressions.", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"default": [] | ||
}, | ||
"fileLogLevel": { | ||
"description": "Set the log level that Stryker uses to write to the \"stryker.log\" file", | ||
"$ref": "#/definitions/logLevel", | ||
"default": "off" | ||
}, | ||
"files": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this still be in the schema, but deprecated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As explained during the community meeting, I don't want people to use it. The rewrite to |
||
"description": "With `files` you can choose which files should be included in your test runner sandbox.\nThis is normally not needed as it defaults to all files not ignored by git.\nTry it out yourself with this command: `git ls-files --others --exclude-standard --cached --exclude .stryker-tmp`.\n\nIf you do need to override `files` (for example: when your project does not live in a git repository),\nyou can override the files here.\n\nWhen using the command line, the list can only contain a comma separated list of globbing expressions.\nWhen using the config file you can provide an array with `string`s", | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"inPlace": { | ||
"type": "boolean", | ||
"description": "Determines whether or not Stryker should mutate your files in place. Note: mutating your files in place is generally not needed for mutation testing, unless you have a dependency in your project that is really dependent on the file locations (like \"app-root-path\" for example).\n\nWhen `true`, Stryker will override your files, but it will keep a copy of the originals in the temp directory (using `tempDirName`) and it will place the originals back after it is done.\n\nWhen `false` (default) Stryker will work in the copy of your code inside the temp directory.", | ||
|
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.
Why do you specify
reports
andstryker.log
with a/
at the front, but not for other files/folders?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.
Because I know for a fact that Stryker places them at the root of your project. For example. I would like the
src/reports
directory that someone might have to be included. Starting with a/
means to only match when it exists in the root of the cwd.