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

(feat) added argument for karma configuration file #4564

Merged
merged 7 commits into from
Feb 10, 2017
Merged

(feat) added argument for karma configuration file #4564

merged 7 commits into from
Feb 10, 2017

Conversation

ruffiem
Copy link

@ruffiem ruffiem commented Feb 9, 2017

Shuts #183

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@ruffiem
Copy link
Author

ruffiem commented Feb 9, 2017

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Feb 9, 2017
@filipesilva
Copy link
Contributor

filipesilva commented Feb 9, 2017

Heya @ruffiem, thanks for adding this. Can you add a test to confirm it works?

You should add it here:
https://github.com/angular/angular-cli/blob/master/tests/e2e/tests/test/test.ts

The easiest way is to move the original config file and use your flag, like here:
https://github.com/filipesilva/angular-cli/blob/6120c0f60cfef8a6f3062408a7f98b4757c4ee5a/tests/e2e/tests/test/e2e.ts#L29-L30
(this file isn't in the repo yet, it's part of #4527)

Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

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

See my comment above about how to make a test.

}


const TestCommand = EmberTestCommand.extend({
availableOptions: [
{ name: 'watch', type: Boolean, default: true, aliases: ['w'] },
{ name: 'code-coverage', type: Boolean, default: false, aliases: ['cc'] },
{ name: 'config-file', type: Boolean, default: false, aliases: ['c', 'cf'] },
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be config with an alias of c to be consistent with the upcoming e2e changes. (#4527)

Copy link
Author

Choose a reason for hiding this comment

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

True but karma prefers --config-file... Which one then ?

Copy link
Member

Choose a reason for hiding this comment

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

Personally, I'd prefer the CLI was consistent with itself. Especially considering karma may not always be the test runner.

Also, the type should be 'Path'.

@ruffiem
Copy link
Author

ruffiem commented Feb 9, 2017

Testing went ok!

@ruffiem
Copy link
Author

ruffiem commented Feb 10, 2017

last commit related to #4577

Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

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

A few more changes please and it LGTM to merge.

I see the CI failed but as far as I can tell it's a flake completely unrelated to your changes.


export default function () {
// make sure both --watch=false and --single-run work
return ng('test', '--single-run')
.then(() => ng('test', '--watch=false'));
.then(() => ng('test', '--watch=false'))
.then(() => copyFile('./karma.conf.js', './karma.conf.bis.js'))
Copy link
Contributor

Choose a reason for hiding this comment

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

Use moveFile instead of copy please, otherwise the feature might be broken and we don't know since the old file is used.

The test harness will take care of moving it back after the test.

@@ -13,7 +13,7 @@ module.exports = Command.extend({

availableOptions: [
{ name: 'environment', type: String, default: 'test', aliases: ['e'] },
{ name: 'config-file', type: String, aliases: ['c', 'cf']},
{ name: 'config', type: String, aliases: ['c', 'cf']},
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to change this, our command overrides this one.

}


const TestCommand = EmberTestCommand.extend({
availableOptions: [
{ name: 'watch', type: Boolean, default: true, aliases: ['w'] },
{ name: 'code-coverage', type: Boolean, default: false, aliases: ['cc'] },
{ name: 'config', type: String, aliases: ['c', 'cf'] },
Copy link
Contributor

Choose a reason for hiding this comment

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

Use just the c alias instead. I understand the old command had both, but we don't use it so no user would know and this way we don't use up another possible alias.

Copy link
Author

Choose a reason for hiding this comment

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

Updated with your comments. Though, 'cc' and 'c' for respectively code coverage and config is little bit scary, no ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's ok enough. It's true that -c -cc is kinda weird, but I'd expect -c to be used much more than -cc, and less so them together. And when users use them together, they shouldn't have to change -c to -cf.

Looking at the PoV of making mistakes, since before both -c and -cf were allowed then you could just as easily mistakenly do -cc instead if you were used to -c.

@filipesilva
Copy link
Contributor

Just waiting on CI to merge.

@filipesilva filipesilva merged commit b9295e0 into angular:master Feb 10, 2017
@filipesilva
Copy link
Contributor

Thanks for this! It closes one of the oldest Angular CLI issues.

@codermannn
Copy link

How do I specify a different karma.conf.js for CI?

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants