-
Notifications
You must be signed in to change notification settings - Fork 12k
fix: karma configuration in ng2 blueprint updated, allowing unit testing on travis. #1738
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
Conversation
…ated application to be unit tested on travis. The original karma configuration contained a custom launcher for travis, but it was not used anywhere. By extending the configuration, it is now automatically applied if travis is detected, and also enabled single run mode for the CI tool.
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! |
CLAs look good, thanks! |
We currently allow doing single run via the I appreciate you taking the time to do the PR, but that is my reasoning for not accepting it. |
Thank you for the answer and the quick decision - you are absolutely right, I also don't think favoring one CI tool over the others would be a good direction for a general tool. The PR was about extending the current travis-specific configuration of From the user's perspective, right now if you want to run your application against a CI tool, you will either have to edit your package.json or your karma.conf.js [you probably want to run your tests on your local machine as well sometimes, this is why adding the commands just to your CI tool's descriptor file (travis.yml for example) would not be enough probably], and there is nothing wrong with that. But when the user generates the application, scans through the generated files, he will see, that there's already a @filipesilva What do you think, would it make sense to remove the |
You know, it completely slipped my mind that we already had the I'd be interested in a PR that removes that from the Karma config, yes. If you are available to do it, I'd point you towards our Maybe there's a good way to do something similar for Karma as well, and we could fully bypass custom Karma config for Travis. |
karma-runner/karma#1144 (comment) seems to have had success doing something similar. |
Hmm, sure, removing the custom runner is not a big deal, I would love to give a PR for that. :) So, as I understand it currently, in order to be able to run karma on any CI tools, there are two requirements that needs to be met:
I can experiment with The other one is more interesting here. Since the karma binary is not called directly, we can't pass This way, no travis specific code has to exist in the codebase, and the behavior could be controlled through environment variables (for example in @filipesilva What do you think about it? Isn't it too hacky? |
In
The |
Maybe it's possible to change the |
Okay, so here are my findings: ng init-ed repository with the new karma.conf.js and it's Travis builds. Looks like |
Oh that's nice! Your technique allows all Travis specific config to be ONLY on For the CLI tests themselves I prefer chromium because it's already installed so it takes less CI time. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The original karma configuration contained a custom launcher for travis (for more details, please check out karma.conf.js), but it was not used anywhere.
By extending the configuration, it is now automatically applied if travis is detected, and also enabled single run mode for the CI tool, otherwise karma wouldn't exit at the end of the tests.
I am not sure however, if adding an out-of-box travis support directly to the blueprint was the original intention behind the custom launcher.