Skip to content

--from flag not working #18

Open
Open
@markgoho

Description

@markgoho
Contributor
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?

Activity

bahmutov

bahmutov commented on Jul 1, 2020

@bahmutov
Owner

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

bahmutov

bahmutov commented on Jul 1, 2020

@bahmutov
Owner

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

markgoho commented on Jul 1, 2020

@markgoho
ContributorAuthor

@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

leosuncin commented on Dec 21, 2020

@leosuncin
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

leosuncin commented on Dec 21, 2020

@leosuncin
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bahmutov@leosuncin@markgoho

        Issue actions

          --from flag not working · Issue #18 · bahmutov/check-code-coverage