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

--from flag not working #18

Open
markgoho opened this issue Jul 1, 2020 · 5 comments
Open

--from flag not working #18

markgoho opened this issue Jul 1, 2020 · 5 comments
Labels
question Further information is requested

Comments

@markgoho
Copy link
Contributor

markgoho commented Jul 1, 2020

Marks-MacBook-Pro:enroll-ui markgoho$ DEBUG=check-code-coverage npx update-badge --from apps/admin-e2e/coverage/coverage-summary.json
  check-code-coverage args: { _: [], '--from': 'apps/admin-e2e/coverage/coverage-summary.json' } +0ms
  check-code-coverage reading coverage from { filename: 'apps/admin-e2e/coverage/coverage-summary.json' } +0ms
  check-code-coverage reading coverage summary from: apps/admin-e2e/coverage/coverage-summary.json +1ms
Cannot find module 'apps/admin-e2e/coverage/coverage-summary.json'
Require stack:
- /Users/markgoho/Projects/enroll-ui/node_modules/check-code-coverage/src/index.js
- /Users/markgoho/Projects/enroll-ui/node_modules/check-code-coverage/bin/update-badge.js

Project folders:
image

Is npx doing something weird?

@bahmutov
Copy link
Owner

bahmutov commented Jul 1, 2020

Maybe, I would run this with relative path like --from ./apps/.. just to see what is going on.

@bahmutov bahmutov added the question Further information is requested label Jul 1, 2020
@bahmutov
Copy link
Owner

bahmutov commented Jul 1, 2020

Also @markgoho thanks for trying it out, appreciate it. Please open any issues and contribute to this repo, I think code coverage and tooling around it could be greatly improved.

@markgoho
Copy link
Contributor Author

markgoho commented Jul 1, 2020

@bahmutov update, this works /Users/markgoho/Projects/enroll-ui/apps/admin-e2e/coverage/coverage-summary.json as the --from path

./apps/admin... does not work

@leosuncin
Copy link
Contributor

I got the same error using npx -p check-code-coverage set-gh-status --from coverage/e2e/coverage-final.json

Stacktrace
Error: Cannot find module '/home/runner/work/mui-next-ts/mui-next-ts/coverage/coverage-summary.json'
Require stack:
- /home/runner/.npm/_npx/4453/lib/node_modules/check-code-coverage/src/index.js
- /home/runner/.npm/_npx/4453/lib/node_modules/check-code-coverage/bin/set-gh-status.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at readCoverage (/home/runner/.npm/_npx/4453/lib/node_modules/check-code-coverage/src/index.js:19:20)
    at setGitHubCommitStatus (/home/runner/.npm/_npx/4453/lib/node_modules/check-code-coverage/bin/set-gh-status.js:17:25)
    at Object. (/home/runner/.npm/_npx/4453/lib/node_modules/check-code-coverage/bin/set-gh-status.js:135:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/.npm/_npx/4453/lib/node_modules/check-code-coverage/src/index.js',
    '/home/runner/.npm/_npx/4453/lib/node_modules/check-code-coverage/bin/set-gh-status.js'
  ]
}

@leosuncin
Copy link
Contributor

I guess the error is because from parameter is not passed inside options

const options = {
filename: args['--file'],
checkAgainstReadme: args['--check-against-readme']
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants