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

Filenames not showing up correctly in report #1140

Closed
sanderkoenders opened this issue Sep 12, 2018 · 7 comments
Closed

Filenames not showing up correctly in report #1140

sanderkoenders opened this issue Sep 12, 2018 · 7 comments
Labels
🐛 Bug Something isn't working 👶 Good first issue Good for newcomers hacktoberfest https://hacktoberfest.digitalocean.com/

Comments

@sanderkoenders
Copy link
Member

sanderkoenders commented Sep 12, 2018

Summary

In one of my recent projects I used Stryker to mutation test. The report does not seem to be correct though because some wierd glitch is showing up in the filenames.
screenshot_20180912_065312

modules/helloController.ts is not working correctly here. My directtory structure looks like:
screenshot_20180912_065654

Stryker config

module.exports = function(config) {
  config.set({
    testRunner: "mocha",
    mutator: "typescript",
    transpilers: ["typescript"],
    reporters: ["html", "clear-text", "progress"],
    packageManager: "npm",
    testFramework: "mocha",
    coverageAnalysis: "perTest",
    tsconfigFile: "tsconfig.json",
    mutate: ["src/**/*.ts"],
    coverageAnalysis: "off"
  });
};

Stryker environment

+-- stryker@0.29.1
+-- stryker-api@0.21.0
+-- stryker-html-reporter@0.16.1
+-- stryker-mocha-framework@0.12.1
+-- stryker-mocha-runner@0.14.1
+-- stryker-typescript@0.13.2
+-- mocha@5.2.0
+-- typescript@3.0.3

Reproduction steps

git clone git@github.com:Archcry/inversify.git
git checkout feat-upgrade-inversify # Might merge into master soon
cd inversify
npm i
npm test

Your Environment

software version(s)
node v10.9.0
npm 6.4.1
Operating System Linux
@simondel
Copy link
Member

Nice find! What does the html reporter say?

@sanderkoenders
Copy link
Member Author

sanderkoenders commented Sep 12, 2018

Basically the same, and it cannot show the contents of the faulty files.

@simondel
Copy link
Member

Does the path exist in the reports folder or is that one also incorrect?

@sanderkoenders
Copy link
Member Author

reports/mutation/html/modules/helloController.ts/ exists in the reports folder. But I think the html-reporter is only reporting what Stryker told it to report. I assume something is going wrong when creating the data for all reports because all reporters seem to have this problem.

@nicojs
Copy link
Member

nicojs commented Sep 12, 2018

Yeah, probably a bug in the recursive function of the ScoreResultCalculator. Could you enable the 'event-recorder' reporter? That way we can see the "onScoreResultCalculated" event. Should be fairly clear.

@sanderkoenders
Copy link
Member Author

sanderkoenders commented Sep 12, 2018

Same result there, I think you're right in saying something is going wrong with the recursion:

{
  "killed": 31,
  "survived": 14,
  "noCoverage": 0,
  "runtimeErrors": 1,
  "transpileErrors": 7,
  "timedOut": 0,
  "totalDetected": 31,
  "totalUndetected": 14,
  "totalCovered": 45,
  "totalValid": 45,
  "totalInvalid": 8,
  "totalMutants": 53,
  "mutationScore": 68.88888888888889,
  "mutationScoreBasedOnCoveredCode": 68.88888888888889,
  "name": "/home/sander/Documents/projects/private/inversify/src",
  "path": "/home/sander/Documents/projects/private/inversify/src",
  "childResults": [
    {
      "killed": 22,
      "survived": 0,
      "noCoverage": 0,
      "runtimeErrors": 1,
      "transpileErrors": 2,
      "timedOut": 0,
      "totalDetected": 22,
      "totalUndetected": 0,
      "totalCovered": 22,
      "totalValid": 22,
      "totalInvalid": 3,
      "totalMutants": 25,
      "mutationScore": 100,
      "mutationScoreBasedOnCoveredCode": 100,
      "name": "ioc",
      "path": "/home/sander/Documents/projects/private/inversify/src/ioc",
      "childResults": [
        {
          "killed": 22,
          "survived": 0,
          "noCoverage": 0,
          "runtimeErrors": 0,
          "transpileErrors": 2,
          "timedOut": 0,
          "totalDetected": 22,
          "totalUndetected": 0,
          "totalCovered": 22,
          "totalValid": 22,
          "totalInvalid": 2,
          "totalMutants": 24,
          "mutationScore": 100,
          "mutationScoreBasedOnCoveredCode": 100,
          "name": "ioc.ts",
          "path": "/home/sander/Documents/projects/private/inversify/src/ioc/ioc.ts",
          "childResults": [],
          "representsFile": true
        },
        {
          "killed": 0,
          "survived": 0,
          "noCoverage": 0,
          "runtimeErrors": 1,
          "transpileErrors": 0,
          "timedOut": 0,
          "totalDetected": 0,
          "totalUndetected": 0,
          "totalCovered": 0,
          "totalValid": 0,
          "totalInvalid": 1,
          "totalMutants": 1,
          "mutationScore": 100,
          "mutationScoreBasedOnCoveredCode": 100,
          "name": "iocUtils.ts",
          "path": "/home/sander/Documents/projects/private/inversify/src/ioc/iocUtils.ts",
          "childResults": [],
          "representsFile": true
        }
      ],
      "representsFile": false
    },
    {
      "killed": 5,
      "survived": 4,
      "noCoverage": 0,
      "runtimeErrors": 0,
      "transpileErrors": 2,
      "timedOut": 0,
      "totalDetected": 5,
      "totalUndetected": 4,
      "totalCovered": 9,
      "totalValid": 9,
      "totalInvalid": 2,
      "totalMutants": 11,
      "mutationScore": 55.55555555555556,
      "mutationScoreBasedOnCoveredCode": 55.55555555555556,
      "name": "modules/helloController.ts",
      "path": "/home/sander/Documents/projects/private/inversify/src/modules/helloController.ts",
      "childResults": [
        {
          "killed": 2,
          "survived": 2,
          "noCoverage": 0,
          "runtimeErrors": 0,
          "transpileErrors": 1,
          "timedOut": 0,
          "totalDetected": 2,
          "totalUndetected": 2,
          "totalCovered": 4,
          "totalValid": 4,
          "totalInvalid": 1,
          "totalMutants": 5,
          "mutationScore": 50,
          "mutationScoreBasedOnCoveredCode": 50,
          "name": "Controller.ts",
          "path": "/home/sander/Documents/projects/private/inversify/src/modules/helloController.ts/Controller.ts",
          "childResults": [],
          "representsFile": true
        },
        {
          "killed": 3,
          "survived": 2,
          "noCoverage": 0,
          "runtimeErrors": 0,
          "transpileErrors": 1,
          "timedOut": 0,
          "totalDetected": 3,
          "totalUndetected": 2,
          "totalCovered": 5,
          "totalValid": 5,
          "totalInvalid": 1,
          "totalMutants": 6,
          "mutationScore": 60,
          "mutationScoreBasedOnCoveredCode": 60,
          "name": "troller.ts",
          "path": "/home/sander/Documents/projects/private/inversify/src/modules/helloController.ts/troller.ts",
          "childResults": [],
          "representsFile": true
        }
      ],
      "representsFile": false
    },
    {
      "killed": 0,
      "survived": 3,
      "noCoverage": 0,
      "runtimeErrors": 0,
      "transpileErrors": 0,
      "timedOut": 0,
      "totalDetected": 0,
      "totalUndetected": 3,
      "totalCovered": 3,
      "totalValid": 3,
      "totalInvalid": 0,
      "totalMutants": 3,
      "mutationScore": 0,
      "mutationScoreBasedOnCoveredCode": 0,
      "name": "constants/types.ts",
      "path": "/home/sander/Documents/projects/private/inversify/src/constants/types.ts",
      "childResults": [],
      "representsFile": true
    },
    {
      "killed": 4,
      "survived": 0,
      "noCoverage": 0,
      "runtimeErrors": 0,
      "transpileErrors": 2,
      "timedOut": 0,
      "totalDetected": 4,
      "totalUndetected": 0,
      "totalCovered": 4,
      "totalValid": 4,
      "totalInvalid": 2,
      "totalMutants": 6,
      "mutationScore": 100,
      "mutationScoreBasedOnCoveredCode": 100,
      "name": "libraries/logger/loggerImpl.ts",
      "path": "/home/sander/Documents/projects/private/inversify/src/libraries/logger/loggerImpl.ts",
      "childResults": [],
      "representsFile": true
    },
    {
      "killed": 0,
      "survived": 7,
      "noCoverage": 0,
      "runtimeErrors": 0,
      "transpileErrors": 1,
      "timedOut": 0,
      "totalDetected": 0,
      "totalUndetected": 7,
      "totalCovered": 7,
      "totalValid": 7,
      "totalInvalid": 1,
      "totalMutants": 8,
      "mutationScore": 0,
      "mutationScoreBasedOnCoveredCode": 0,
      "name": "main.ts",
      "path": "/home/sander/Documents/projects/private/inversify/src/main.ts",
      "childResults": [],
      "representsFile": true
    }
  ],
  "representsFile": false
}

@nicojs nicojs added 🐛 Bug Something isn't working 👶 Good first issue Good for newcomers labels Sep 13, 2018
@simondel simondel added the hacktoberfest https://hacktoberfest.digitalocean.com/ label Oct 1, 2018
@sanderkoenders
Copy link
Member Author

Solved in #1165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working 👶 Good first issue Good for newcomers hacktoberfest https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

No branches or pull requests

3 participants