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

Enable parallelization for @stryker-mutator/jest-runner plugin #4861

Open
raghav2008gupta opened this issue May 3, 2024 · 1 comment
Open
Labels
🚀 Feature request New feature request

Comments

@raghav2008gupta
Copy link

Initial test run is taking too long

@stryker-mutator/jest-runner should allow parallelization

Slack thread with discussion details: https://stryker-mutator.slack.com/archives/CTYUW4B0E/p1714755891637819

@raghav2008gupta raghav2008gupta added the 🚀 Feature request New feature request label May 3, 2024
@nicojs
Copy link
Member

nicojs commented May 7, 2024

The main takeaways from that conversation:

  1. You're running StrykerJS with --incremental. This means most of the time is spent on the initial test run to calculate the test&mutant coverage matrix.
  2. Initial test run takes more than 3 minutes

In this scenario, a paralyzed initial test run would save a lot of time (assuming the CI runner has more than 2 cores).

Stryker config:

module.exports = {
  allowEmpty: true,
  checkers: ['typescript'],
  cleanTempDir: true,
  coverageAnalysis: 'perTest',
  ignorePatterns: [
    'packages/components/__tests__/atoms/Avatar/Avatar.test.tsx',
    'packages/components/__tests__/molecules/cards/ProfileSummary/ProfileSummary.test.tsx',
  ],
  ignoreStatic: true,
  incremental: true,
  jest: {
    projectType: 'custom',
    configFile: 'jest.config.js',
    enableFindRelatedTests: true,
  },
  mutate: [
    'packages/components/atoms/**/*.ts',
    'packages/components/atoms/**/*.js',
    'packages/components/molecules/**/*.ts',
    'packages/components/molecules/**/*.js',
    'packages/core/src/**/*.ts',
    'packages/core/src/**/*.js',
  ],
  reporters: ['progress', 'clear-text', 'html'],
  tempDirName: 'stryker-tmp',
  thresholds: {
    high: 95,
    low: 75,
    break: 64,
  },
  testRunner: 'jest',
  tsconfigFile: 'tsconfig.json',
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature request
Projects
None yet
Development

No branches or pull requests

2 participants