Stryker: Incorrect relative path for html reporter

Created on 10 Jul 2017  路  20Comments  路  Source: stryker-mutator/stryker

_This is a repost :pencil: of @michaelpcote stryker-html-reporter issue #13_
---------------------------------------------------------------------------------------------------------------------
I've run into an issue that is causing 404 errors that makes the html reports unusable.

The issue occurs whenever the report is able to condense a path to something like:

  • parentDir/childDir

This happens because there is only 1 child directory or because only 1 child directory has .js files. For instance, because we are grouping our features together like this:

  • feature

    • js (contains directives, services, controllers)

    • css

    • partials

It is formatting incorrectly every time. The issue is that the report on the upper level will show
feature/js. When you click into this link it then shows the js directory and all the files completely unstyled. The index.html for that file then is trying to reference the bootstrap and stryker.js files 1 level up, like "../bootstrap" when it should actually be "../../bootstrap".

馃悰 Bug

All 20 comments

Steps to reproduce:

  1. clone https://github.com/nicojs/sample-project-stryker
  2. npm install
  3. run npm test

Browse through the html report. Some css files are not loaded correctly.

Works like a charm with the rewrite-branch 馃憤

Can I pick up this fix by pulling in the existing 0.4.7 release? Or does it still need to be built to a new version?

This hasn't been released yet. We'll notify you when we do :)

You could test it locally before release:

  • Clone the stryker repository
  • run npm i and npm run build inside the stryker folder.
  • Install your local versions into your project: npm i file:../stryker/packages/stryker file:../stryker/packages/stryker-api file:../stryker/packages/stryker-html-reporter (this is assuming you cloned stryker right next to your project's package)

We've just released [email protected] [email protected] and [email protected]. @j-truax you should be able to use it now.

Thanks for the update. Will get it installed and test it out!

I pulled in the latest versions of the modules defined here so that I could test out this fix and try out the new threshold config option. However, I am running into issues when running "npm update". What are the versions I need to bring in to test with the latest releases?

package.json...

"grunt-stryker": "0.6.1",
"stryker": "0.8.0",
"stryker-api": "0.7.0",
"stryker-html-reporter": "0.6.0",
"stryker-jasmine": "0.4.0",
"stryker-karma-runner": "0.6.0"

Running npm install with the above, I get...

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants stryker@^0.7.0

If I downgrrade "stryker" to 0.7.0, I get...

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants stryker-api@^0.7.0
npm ERR! peerinvalid Peer [email protected] wants stryker-api@^0.7.0
npm ERR! peerinvalid Peer [email protected] wants stryker-api@^0.6.0
npm ERR! peerinvalid Peer [email protected] wants stryker-api@^0.7.0

Stryker should be version 0.8.0. Versions of stryker and his friends are not yet locked. So some packages are updated more frequently than other because of semantic versioning (http://semver.org/).

Then what version of his friends should I be using? Using 0.8.0 of stryker causes grunt-stryker to complain and want a lower version of stryker.

Hmm true, it seems that stryker's peerDependency version in grunt-stryker hasn't updated. It's an automated process which apparently still has some quirks. I'll release a new version in the next hour.

Version 0.7.0 of grunt-stryker just released, which is compatible with v0.8.0 of Stryker.

@nicojs Thanks for fixing, I'll get it pulled down and start testing.

Ok, got a chance to test and it looks like we are still seeing an issue. Let me know if you want me to open a separate issue for this.

Github Sample Project --> REPORT SUCCESSFUL
|
|__src
    |
    |__blaat
    |   |
    |   |__two
    |       |
    |       |__Array.js
    |       |__Circle.js
    |
    |__Add.js


Bad Project --> REPORT UNSUCCESSFUL
|
|__src
    |
    |__blaat
        |
        |__two
            |
            |__three
                |
                |__four
                |   |
                |   |__Circle.js <-- Report's index.html shows row for this but clicking shows 404 because there is no corresponding sub-report html file.
                |
                |__Add.js
                |__Subtract.js



Good Project --> REPORT SUCCESSFUL
|
|__src
    |
    |__blaat
        |
        |__two
            |
            |__three
                |
                |__four
                |   |
                |   |__Array.js <-- Additional file seems to fix the issue
                |   |__Circle.js
                |
                |__Add.js
                |__Subtract.js

Just be sure all npm modules are up to date, could you print the result of npm ls stryker? Incompatible stryker vs stryker-html-reporter could explain this behaviour.

We are using the following...

        "grunt-stryker": "0.7.0",
        "stryker": "0.8.0",
        "stryker-api": "0.7.0",
        "stryker-html-reporter": "0.6.0",
        "stryker-jasmine": "0.4.0",
        "stryker-karma-runner": "0.6.0"

@j-truax that looks correct. Is this the same issue as https://github.com/stryker-mutator/stryker/issues/363 by any change?

@nicojs - Yes, I believe it is. Should I move my comments to that thread?

If you have something to add to the issue, sure. I think this original issue is fixed.

@nicojs - Sounds good. Moved the my recent comments to that thread.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prsn670 picture prsn670  路  22Comments

nosideeffects picture nosideeffects  路  32Comments

simondel picture simondel  路  17Comments

nicojs picture nicojs  路  17Comments

Chowarmaan picture Chowarmaan  路  18Comments