danger-plugin-istanbul-coverage icon indicating copy to clipboard operation
danger-plugin-istanbul-coverage copied to clipboard

Report file set does not work for "created" or "createdOrModified" groups

Open pc-mwong opened this issue 5 years ago • 1 comments

Hello , the following config options do not seem to work as expected.

Issue Summary:

  • Files are not displayed when using these two options for "created" and "createdOrModified"
  • Code coverage report is correctly displayed when using "all"

Investigation Results:

  • possibly filterForCoveredFiles is failing to return an array of files
  • seems like file paths are not in sync for files found with danger.git.modified_files vs files from coverage

My setup:

  • using "danger-plugin-istanbul-coverage": "^1.6.2",

  • Followed the documentation for this setup https://danger.systems/js/plugins/danger-plugin-istanbul-coverage.html

const coverageConfig = {
  coveragePath: {
    path: path.resolve(
      __dirname,
      "...customPath/coverage-summary.json"
    ),
    type: "json-summary"
  },
  reportMode: "warn",
  entrySortMethod: "least-coverage",
  reportFileSet: "createdOrModified",
  numberOfEntries: 20,
  threshold: {
    statements: 40,
    branches: 40,
    functions: 40,
    lines: 40
  }
};

pc-mwong avatar Sep 30 '20 21:09 pc-mwong

After investigating this further,

I discovered the file paths from coverage-summary.json and danger.git.modified_files do not match when using the public danger github action

I've switched to run danger directly instead of using the github action which "solved" the issue.

this is still seems to be a valid issue with the plugin

pc-mwong avatar Oct 09 '20 11:10 pc-mwong