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

Stryker do not update mutation coverage after adding new tests #5017

Open
mykhailokonst opened this issue Sep 20, 2024 · 3 comments
Open

Stryker do not update mutation coverage after adding new tests #5017

mykhailokonst opened this issue Sep 20, 2024 · 3 comments
Labels
⁉ Question Further information is requested

Comments

@mykhailokonst
Copy link

mykhailokonst commented Sep 20, 2024

Question

I ran initial mutation tests.
After checking some react component, I add some tests to increase its mutation coverage. I checked these new tests are failng in case of specific mutations manually.
But after new stryker run, the report did not changed correctly.
If I delete incremental file, and run tests from scratch, it show correct coverage.

Stryker environment

"@stryker-mutator/core": "^7.2.0",
"@stryker-mutator/jest-runner": "^7.2.0",
+-- jest@29.5.0

Additional context

module.exports = {
  concurrency: 6,
  coverageAnalysis: "all",
  disableTypeChecks: "{test,src,lib}/**/*.{js,ts,jsx,tsx,html}",
  dryRunTimeoutMinutes: 50,
  htmlReporter: { fileName: "reports/stryker/stryker.html" },
  ignoreStatic: false,
  incremental: true,
  incrementalFile: "stryker-config/stryker-temp.json",
  jest: {
    configFile: "config/jest.config.js",
  },
  jsonReporter: { fileName: "reports/stryker/stryker.json" },
  mutate: [
    // "src/**/*.{js,jsx,ts,tsx}",
    //Stryker Exclusions:
    "!src/shared/constants/**/*.{js,jsx,ts,tsx}",
    // General Exclusions
    "!src/{i18n,services,modules,types}/**/*",
    "!src/**/module.*",
    "!src/**/modules.*",
    "!src/**/routes.*",
    "!src/**/types.*",

    // Specific Exclusions
    "!src/{main.{js,ts,jsx,tsx},polyfills.js}",
    "!src/{tools,icons,testing}/**/*",

    // Aligment with jest.config.js
    "!src/{fixtures,test,__tests__,testing}/**/*",
    "!src/**/*.test.*",
    "!src/**/*.spec.*",
  ],
  mutator: {
    excludedMutations: ["StringLiteral", "ArrayDeclaration", "MethodExpression", "ObjectLiteral", "OptionalChaining"],
  },
  packageManager: "npm", // Default: 5
  reporters: ["clear-text", "progress", "html", "json"],
  tempDirName: ".stryker-tmp",
  testRunner: "jest",
  testRunnerNodeArgs: ["--no-compilation-cache", "--max-old-space-size=6144", "--expose-gc"],
  timeoutFactor: 6,
  timeoutMS: 600000,
};
@mykhailokonst mykhailokonst added the ⁉ Question Further information is requested label Sep 20, 2024
@nicojs
Copy link
Member

nicojs commented Sep 29, 2024

This seems to work as expected. You're running with coverageAnalysis: "all", which means that StrykerJS cannot detect the specific coverage of newly added tests. Could you try running with coverageAnalysis: "perTest"?

Hmm this should be documented in the limitations docs 🤔

@mykhailokonst
Copy link
Author

@nicojs , I try to run the stryker with perTest value. But I faced with such error:

Screenshot 2024-10-03 at 15 25 08 Screenshot 2024-10-03 at 15 25 15

@mykhailokonst
Copy link
Author

I am out of RAM memory each run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⁉ Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants