Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Set up mutation tests #167

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Conversation

thewilkybarkid
Copy link
Contributor

Configures and runs Stryker, a mutation tester.

@thewilkybarkid thewilkybarkid added the ⚙️ CI Changes to the continuous integration configuration files and scripts label Jan 9, 2020
This was referenced Jan 10, 2020
@thewilkybarkid
Copy link
Contributor Author

Stryker isn't working with Jest 25.1.0 (stryker-mutator/stryker-js#1983), but https://github.com/libero/article-store/pull/167/checks?check_run_id=407401318#step:5:17 is green when it shouldn't be.

@nlisgo
Copy link
Member

nlisgo commented Jan 27, 2020

Stryker isn't working with Jest 25.1.0 (stryker-mutator/stryker#1983), but https://github.com/libero/article-store/pull/167/checks?check_run_id=407401318#step:5:17 is green when it shouldn't be.

I just ran this locally and can confirm that after running make mutation-test although errors are displayed the scripts exits with code 0.

➜  article-store git:(stryker) ✗ make mutation-testdocker-compose --file .docker/docker-compose.yml --file .docker/docker-compose.dev.yml run --rm app npm run test:mutation

> @ test:mutation /app
> stryker run

12:31:14 (17) INFO ConfigReader Using stryker.conf.js in the current working directory.
12:31:14 (17) INFO TypescriptConfigEditor Loading tsconfig file /app/tsconfig.json
12:31:14 (17) INFO InputFileResolver Found 22 of 42 file(s) to be mutated.
12:31:14 (17) INFO InitialTestExecutor Starting initial test run. This may take a while.
12:31:17 (17) ERROR InitialTestExecutor One or more tests resulted in an error:
        Test runner crashed. Tried twice to restart it without any luck. Last time the error message was: Error: TypeError: Cannot read property 'runCLI' of undefined
TypeError: Cannot read property 'runCLI' of undefined
    at JestPromiseTestAdapter.run (/app/node_modules/@stryker-mutator/jest-runner/src/jestTestAdapters/JestPromiseTestAdapter.js:17:31)
    at JestTestRunner.run (/app/node_modules/@stryker-mutator/jest-runner/src/JestTestRunner.js:43:56)
    at ChildProcessTestRunnerWorker.run (/app/node_modules/@stryker-mutator/core/src/test-runner/ChildProcessTestRunnerWorker.js:24:56)
    at ChildProcessProxyWorker.doCall (/app/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:75:56)
    at Promise.then.send.correlationId (/app/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:46:53)
    at new Promise (<anonymous>)
    at ChildProcessProxyWorker.handleMessage (/app/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:46:17)
    at process.emit (events.js:223:5)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
Error: TypeError: Cannot read property 'runCLI' of undefined
TypeError: Cannot read property 'runCLI' of undefined
    at JestPromiseTestAdapter.run (/app/node_modules/@stryker-mutator/jest-runner/src/jestTestAdapters/JestPromiseTestAdapter.js:17:31)
    at JestTestRunner.run (/app/node_modules/@stryker-mutator/jest-runner/src/JestTestRunner.js:43:56)
    at ChildProcessTestRunnerWorker.run (/app/node_modules/@stryker-mutator/core/src/test-runner/ChildProcessTestRunnerWorker.js:24:56)
    at ChildProcessProxyWorker.doCall (/app/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:75:56)
    at Promise.then.send.correlationId (/app/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:46:53)
    at new Promise (<anonymous>)
    at ChildProcessProxyWorker.handleMessage (/app/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxyWorker.js:46:17)
    at process.emit (events.js:223:5)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
    at ChildProcess.<anonymous> (/app/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxy.js:133:68)
    at ChildProcess.emit (events.js:223:5)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
12:31:17 (17) ERROR StrykerCli an error occurred Error: Something went wrong in the initial test run
    at InitialTestExecutor.validateResult (/app/node_modules/@stryker-mutator/core/src/process/InitialTestExecutor.js:86:15)
    at InitialTestExecutor.run (/app/node_modules/@stryker-mutator/core/src/process/InitialTestExecutor.js:41:14)
    at async Stryker.runMutationTest (/app/node_modules/@stryker-mutator/core/src/Stryker.js:54:38)
12:31:17 (17) INFO StrykerCli Trouble figuring out what went wrong? Try `npx stryker run --fileLogLevel trace --logLevel debug` to get some more info.
➜  article-store git:(stryker) echo $?           
0

@nlisgo
Copy link
Member

nlisgo commented Jan 27, 2020

@thewilkybarkid
Copy link
Contributor Author

Stryker 3.0 has been released, which is compatible with Jest 25.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⚙️ CI Changes to the continuous integration configuration files and scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants