-
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
try Stryker Mutator 4 (beta) #42
base: main
Are you sure you want to change the base?
Conversation
I have now updated to use commander runner with Stryker 4.0.0-beta.3 & merged a few updates from master. I encountered a memory issue with node --max-old-space-size=40000 ./node_modules/.bin/stryker run --fileLogLevel trace --logLevel debug I am now getting errors from the initial test run like this: FAIL tests_integration/__tests__/file-info.js
● Test suite failed to run
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html
Details:
/home/brodybits/prettier/.stryker-tmp/sandbox2376464/src/language-js/utils.js:1981
return __global_69fa48.__activeMutant__ === 17201 ? text.slice(start, __global_69fa48.__activeMutant__ === 17205 ? start - 2 : (__global_69fa48.__coverMutant__(17205), start + 2)) === (__global_69fa48.__activeMutant__ === 17206 ? "" : (__global_69fa48.__coverMutant__(17206), "")) : __global_69fa48.__activeMutant__ === 17200 ? false : __global_69fa48.__activeMutant__ === 17199 ? true : (__global_69fa48.__coverMutant__(17199, 17200, 17201), (__global_69fa48.__activeMutant__ === 17204 ? text.slice(start, __global_69fa48.__activeMutant__ === 17205 ? start - 2 : (__global_69fa48.__coverMutant__(17205), start + 2)) !== "")))));
^
SyntaxError: Unexpected token ')'
14 | shouldFlatten,
15 | getPrecedence,
> 16 | } = require("./utils");
| ^
17 |
18 | function needsParens(path, options) {
19 | const parent = path.getParentNode();
at Runtime._execModule (../../node_modules/jest-runtime/build/index.js:1179:56)
at Object.<anonymous> (src/language-js/needs-parens.js:16:5) P.S. A step after the Instrumenter took a really long time (over 30 minutes), see this: 09:25:19 (2339) INFO Instrumenter Instrumented 115 source file(s) with 23085 mutant(s)
09:58:25 (2339) DEBUG TSConfigPreprocessor Rewriting file File {
name: '/home/brodybits/prettier/tsconfig.json',
_content: <Buffer 7b 0a 20 20 22 63 6f 6d 70 69 6c 65 72 4f 70 74 69 6f 6e 73 22 3a 20 7b 0a 20 20 20 20 22 61 6c 6c 6f 77 4a 73 22 3a 20 74 72 75 65 2c 0a 20 20 20 20 ... 1343 more bytes>,
_textContent: '{\n' +
' "compilerOptions": {\n' +
' "allowJs": true,\n' +
' "checkJs": true,\n' +
' "noEmit": true,\n' +
' "target": "es2015",\n' +
' "module": "commonjs",\n' +
' "resolveJsonModule": true,\n' +
' // TBD it is desired to enabled strict type checking at some point:\n' +
' "strict": false\n' +
' },\n' +
' "exclude": [\n' +
' "coverage/",\n' +
' "test*.*",\n' +
' // [TBD] JavaScript sources *not* affected by src/language-*:\n' +
' "src/main/ast-to-doc.js",\n' +
' "src/main/core.js",\n' +
' "src/common/create-ignorer.js",\n' +
' "src/common/parser-create-error.js",\n' +
' "src/config/resolve-config.js",\n' +
' "src/main/options-normalizer.js",\n' +
' "src/common/get-file-info.js",\n' +
' "src/main/multiparser.js",\n' +
' "src/main/options.js",\n' +
' // [TBD] src/language-* source directory trees with known JSDoc type issues:\n' +
' "src/language-html",\n' +
' "src/language-js",\n' +
' // [TBD] JavaScript sources affected by JSDoc issues in src/language-*:\n' +
' "src/common/load-plugins.js",\n' +
' "src/cli/index.js",\n' +
' "src/cli/expand-patterns.js",\n' +
' "src/cli/util.js",\n' +
' "src/cli/constant.js",\n' +
' "src/cli/prettier-internal.js",\n' +
' "src/languages.js",\n' +
' // [TBD] top-level JavaScript sources affected by JSDoc issues\n' +
' // in other sources:\n' +
' "src/index.js",\n' +
' "src/standalone.js",\n' +
' "index.js",\n' +
' "standalone.js",\n' +
' "bin/",\n' +
' "dist/",\n' +
' "docs/",\n' +
' "scripts/",\n' +
' "tests/",\n' +
' "tests_config/",\n' +
' "tests_integration/",\n' +
' "website/"\n' +
' ]\n' +
'}\n'
} |
I replaced
I will probably rebase the commits to clean out old commits no longer needed. |
This is an attempt to try Stryker 4 beta with mutation switching as discussed in: stryker-mutator/stryker-js#1514
Some high-level JavaScript files are not included in the mutate list, and I removed a couple src files to avoid memory issues:
src/language-js/needs-parens.js
src/language-js/printer-estree.js
initial results with Stryker 4.0.0-beta.2, with Jest mutator
At this point `npx stryker run --fileLogLevel trace --logLevel debug --timeoutMS 5000000` on an 8 vCPU cloud instance gives me this timeout error, shows more debug trace, then goes quiet:I did try Stryker v2 in PR #16 last year but did not get so far.
✨Try the playground for this PR✨