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

Runtime errors #977

Closed
samfoot opened this issue Jul 12, 2018 · 7 comments
Closed

Runtime errors #977

samfoot opened this issue Jul 12, 2018 · 7 comments
Assignees

Comments

@samfoot
Copy link

samfoot commented Jul 12, 2018

Summary

I am getting a large number of runtime errors when running stryker. I have tried running with loglevel: 'debug' but I don't see any obvious errors, the tests run manually with jest without issue. How can I find out what is causing me to have so many runtime errors?

Stryker config

module.exports = function(config) {
  config.set({
    testRunner: "jest",
    mutator: "javascript",
    transpilers: [],
    // logLevel: 'debug',
    reporter: ["clear-text", "progress"],
    coverageAnalysis: "off",
    mutate: [
      'src/**/*.js',
      '!src/**/*.test.js',
      '!src/test/*',
    ],
  });
};

Stryker environment

Your Environment

software version(s)
node 10.6.0
npm 6.1.0
Operating System OSX 10.13.5

Screenshot

screen shot 2018-07-12 at 10 52 25

@nicojs
Copy link
Member

nicojs commented Jul 12, 2018

Hmm interesting. Could you try again with loglevel: 'trace'? Testrunner processes are currently silenced unless loglevel is trace.

@samfoot
Copy link
Author

samfoot commented Jul 12, 2018

thanks for getting back to me @nicojs

I ran it with trace and I am now getting loads of Mutant caused a runtime error! errors in the output:

screen shot 2018-07-12 at 11 07 55

I also don't see any of these errors as it's running, just loads of [2018-07-12 11:14:55.643] [TRACE] TestRunnerChildProcessAdapter - [2018-07-12 11:14:55.643] [TRACE] JestPromiseTestAdapter - Invoking Jest with config calls

@nicojs
Copy link
Member

nicojs commented Jul 12, 2018

If you scroll up you should be able to see the runtime errors themselves. It is printed before the actual results. We're working on a feature for logging to a file. Untill then, you could use stryker run > out.txt to redirect output to a file

@samfoot
Copy link
Author

samfoot commented Jul 12, 2018

I can't see any runtime errors in the output. I just ran one of the tests manually by copying the trace output:

{"collectCoverage":false,"collectCoverageFrom":["**/*.{js,jsx}","!**/node_modules/**","!src/test/**","!coverage/**","!src/index.js"],"coverageReporters":["text","lcov"],"coverageThreshold":{"global":{"branches":10,"functions":10,"lines":10,"statements":10}},"verbose":false,"bail":false,"rootDir":"/Users/sf/proj1/.stryker-tmp/sandbox7222091","reporters":[]}

When I run the above I get no output at all, if I remove "reporters":[] I see jest running the tests correctly.

@nicojs
Copy link
Member

nicojs commented Jul 12, 2018

Hmm ok, so we know the problem is somewhere in Stryker. Could you send me the console output somehow? You can use nicojs [AT] infosupport [DOT] com (no spaces)

@samfoot
Copy link
Author

samfoot commented Jul 13, 2018

With the help of @nicojs we found the problem to be one of my tests leaking state. A global Object.defineProperty in one of my dependencies was causing Jest to throw a TypeError: Cannot redefine property: error, this happens in Stryker because the same test is being run multiple times in the same process.

Currently these errors are not being output to the user even with the loglevel: 'trace' configuration, which makes it hard to debug.

Many thanks to @nicojs for the help, and the whole Stryker team for creating an awesome tool.

@ghost ghost assigned nicojs Jul 17, 2018
@ghost ghost added the 🛠 In progress label Jul 17, 2018
simondel pushed a commit that referenced this issue Jul 20, 2018
Add debug logging of run time error messages for all test runners.

Fixes #977
@ghost ghost removed the 🔎 Needs review label Jul 20, 2018
@Prerna237
Copy link

Prerna237 commented May 22, 2019

With the help of @nicojs we found the problem to be one of my tests leaking state. A global Object.defineProperty in one of my dependencies was causing Jest to throw a TypeError: Cannot redefine property: error, this happens in Stryker because the same test is being run multiple times in the same process.

Currently these errors are not being output to the user even with the loglevel: 'trace' configuration, which makes it hard to debug.

Many thanks to @nicojs for the help, and the whole Stryker team for creating an awesome tool.

@samfoot: Could you name the dependency that was causing this problem? I am facing a similar issue here

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

No branches or pull requests

3 participants