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

Set --prefix only for format-coverage subcommand. #118

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ export function run(
`codeclimate.${i}.json`
];
if (codeClimateDebug === 'true') commands.push('--debug');
if (!coveragePrefix && typeof coveragePrefix === 'string') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paambaati - As far as I can tell this logic is only going to append --prefix when coveragePrefix is "" (empty string). I'd make a PR to address/fix but I'm not quite sure what the goal here is. Are you trying to only add --prefix only when coveragePrefix was passed?

Copy link
Contributor

@rwjblue rwjblue Mar 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, I'm seeing the following command being executed (note the --prefix without additional argument):

/home/runner/work/ember-cli/ember-cli/cc-reporter format-coverage coverage/lcov.info -t lcov -o codeclimate.0.json --prefix 

When the configuration is:

      - name: Test && Report to Code Climate
        uses: paambaati/codeclimate-action@v2.5.4
        with:
          coverageCommand: yarn test:cover
          coverageLocations: "coverage/lcov.info:lcov"

See the line here

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you trying to only add --prefix only when coveragePrefix was passed?

That is correct.

I'd make a PR to address/fix

Much appreciated, please and thank you.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem! Here is what I was thinking #131 for the solution.

commands.push('--prefix', coveragePrefix);
}

parts.push(`codeclimate.${i}.json`);

Expand Down Expand Up @@ -156,8 +159,6 @@ export function run(
try {
const commands = ['after-build', '--exit-code', lastExitCode.toString()];
if (codeClimateDebug === 'true') commands.push('--debug');
if (typeof coveragePrefix === 'string')
commands.push('--prefix', coveragePrefix);
await exec(executable, commands, execOpts);
debug('✅ CC Reporter after-build checkin completed!');
return resolve();
Expand Down