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

files not skipped on windows #484

Closed
RyanHubs opened this issue Mar 19, 2020 · 5 comments
Closed

files not skipped on windows #484

RyanHubs opened this issue Mar 19, 2020 · 5 comments

Comments

@RyanHubs
Copy link

Hi,
I got an issue when running coverage on windows.
Should I convert a windows path to posix path?

version: solidity-coverage@0.7.2
system: win10 x64
.solcover.js: 
module.exports = {
    skipFiles:        ["./common/EIP712.sol"],
    istanbulFolder:   "./doc/coverage/",
    istanbulReporter: ["html"],
};
code: solidity-coverage/plugins/resources/plugin.utils.js line142
function assembleTargets(config, targets=[], skipFiles=[]){
  const skipped = [];
  const filtered = [];
  const cd = config.contractsDir;

  for (let target of targets){
    if (skipFiles.includes(target)){

      skipped.push({
        canonicalPath: target,
        relativePath: toRelativePath(target, cd),
        source: loadSource(target)
      })

    } else {

      filtered.push({
        canonicalPath: target,
        relativePath: toRelativePath(target, cd),
        source: loadSource(target)
      })
    }
  }

  console.log(`targets:${JSON.stringify(targets)}`)
  console.log(`skipFiles:${JSON.stringify(skipFiles)}`)
  return {
    skipped: skipped,
    targets: filtered
  }
}
log:
targets:["C:/common/contracts/common/EIP712.sol",
             "C:/common/contracts/Migrations.sol"]
skipFiles:["C:\\common\\contracts\\common\\EIP712.sol",
               "C:\\common\\contracts\\Migrations.sol"]
@cgewecke
Copy link
Member

@RyanHubs Thanks for reporting. I don't have windows box ... could you help test a solution?

If you modify this:

const targets = shell.ls(targetsPath);

..to this, does that fix it?

const targets = shell.ls(targetsPath).map(path.normalize);

@RyanHubs
Copy link
Author

Thank you for your quick reply,
I have verified that the modification can get the correct result.

@AleG94
Copy link

AleG94 commented Apr 6, 2020

When is it going to be released? I'm currently stuck between this and #481.
I can't parse the file nor exclude it from coverage.

@cgewecke
Copy link
Member

cgewecke commented Apr 6, 2020

@AleG94 Apologies, I will publish again today.

@cgewecke
Copy link
Member

cgewecke commented Apr 6, 2020

Published with 0.7.3

@cgewecke cgewecke closed this as completed Apr 6, 2020
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